Chapterبەش 5 · Lectureوانە 5.1
The Network Layer and the IPv4 Packetچینی ڕایەڵە و پاکێتی IPv4
The network layer carries each packet from the host that sends it to the host it is for, across many networks, and its protocol is IP. It addresses, encapsulates, routes and decapsulates; IPv4 is connectionless, best effort and media independent — but every link has an MTU. The 20-byte IPv4 header field by field (DSCP/ECN, TTL, protocol numbers 1, 6 and 17, the checksum), a real header decoded, fragmentation with offsets in 8-byte units, path MTU discovery, and a first look at the simpler IPv6 header.
هەر لەو کە دەینێرێت دەگەیەنێتە ئەو بۆی نێردراوە، بە ناو چەندین ؛ . ناونیشان دادەنێت، دەپێچێتەوە، دەکات و دەیکاتەوە؛ ، بەکار دەهێنێت و سەربەخۆیە لە — بەڵام هەر بەستەرێک خۆی هەیە. سەردێڕی 20 IPv4 خانە بە خانە (DSCP/ECN، TTL، ژمارەکانی 1، 6 و 17، )، شیکردنەوەی سەردێڕێکی ڕاستەقینە، بە offset بە یەکەی 8 ، دۆزینەوەی ڕێگا و سەیرێکی سەرەتایی سادەتری .
What you will learnچی فێر دەبیت
- Describe the network layer’s job and its four basic operations, and explain why IP is a network-layer protocol.
- Explain what connectionless, best effort and media independent mean for IPv4 — and what they do not mean.
- Read the IPv4 header field by field, including DSCP/ECN, TTL and the protocol number.
- Fragment a packet correctly, with offsets in 8-byte units, and explain path MTU discovery.
- Compare the IPv4 header with the simpler IPv6 header.
- ئەرکی و چوار کردارە بنەڕەتییەکەی وەسف بکەیت و ڕوونی بکەیتەوە بۆچی .
- ڕوونی بکەیتەوە ، و سەربەخۆیی لە چ واتایەکیان بۆ هەیە — و چ واتایەکیان نییە.
- IPv4 خانە بە خانە بخوێنیتەوە، لەوانە DSCP/ECN، TTL و ژمارەی .
- بە دروستی پارچە بکەیت، بە offset بە یەکەی 8 ؛ هەروەها دۆزینەوەی ڕێگا ڕوون بکەیتەوە.
- IPv4 لەگەڵ سادەتری بەراورد بکەیت.
Layer 3: from one end device to anotherچینی 3: لە ئامێرێکی کۆتاییەوە بۆ ئامێرێکی کۆتایی تر
The network layer — OSI layer 3, called the internet layer in the TCP/IP model — has one job: to carry each packet from the device that sends it to the device it is for, from one end device to another, across all the networks that lie between them (OSI layers 1–3). Its protocol is the Internet Protocol (IP), today in two versions, IPv4 and IPv6: the network-layer protocol of the Internet. IP is not a transport-layer protocol — TCP and UDP work above it.
— چینی 3ی ، کە لە مۆدێلی پێی دەگوترێت چینی ئینتەرنێت — یەک ئەرکی هەیە: هەر لەو ئامێرەوە کە دەینێرێت بگەیەنێتە ئەو ئامێرەی بۆی نێردراوە، لە بۆ تر، بە ناو هەموو نێوانیاندا (چینەکانی 1–3ی OSI). (Internet Protocol)، کە ئەمڕۆ دوو وەشانی هەیە، IPv4 و IPv6: . نییە — و لە سەرووی ئەوەوە کار دەکەن.
Other network-layer protocols appear in old books — Novell’s IPX, Apple’s AppleTalk and CLNS/DECnet — all of them history now. IP works with two helpers: ICMP carries error and test messages such as ping (ICMP, Ping and Traceroute), and ARP finds the MAC address that belongs to an IPv4 address (ARP); ARP really sits between layers 2 and 3.
تری لە کتێبە کۆنەکاندا دەبینرێن — IPXـی Novell، AppleTalkـی Apple و CLNS/DECnet — هەموویان ئێستا مێژوون. لەگەڵ دوو یاریدەدەر کار دەکات: پەیامی هەڵە و تاقیکردنەوە دەگوازێتەوە، وەک (ICMP، پینگ و بەدواداچوونی ڕێگە)؛ بۆ هەر ناونیشانێکی IPv4 ئەو پێوەی بەستراوە دەدۆزێتەوە (ARP)؛ لە ڕاستیدا لە نێوان چینی 2 و 3دایە.
Four jobs: address, encapsulate, route, decapsulateچوار ئەرک: ناونیشان، پێچانەوە، ڕێدۆزی، هەڵوەشاندن
To carry data from end to end, the network layer does four things. Between the sending host and the receiving host, the routers use only layers 1–3 (from X to Y through three routers).
بۆ گەیاندنی لە سەرێکەوە بۆ سەرەکەی تر، چوار کار دەکات. لە نێوان نێرەر و وەرگردا، تەنیا چینی 1 تا 3 بەکار دەهێنن (لە X بۆ Y بە ناو سێ ڕێدۆزدا).
- Addressingناونیشانکردن
Every end device gets an IP address: a logical address that also says which network the device is on.
هەر وەردەگرێت: ناونیشانێکی لۆجیکی کە دەشڵێت ئامێرەکە لەسەر کام .
- Encapsulationپێچانەوە
The sending host puts the transport-layer segment inside a packet, whose header holds the source and destination IP addresses.
نێرەر دەخاتە ناو کە سەرچاوە و مەبەست هەڵدەگرێت.
- Routingڕێدۆزی
Routers choose a path for each packet, one hop at a time: each looks up the destination network in its routing table and passes the packet to the next hop — the next router — or delivers it on the last network (How a Packet Finds Its Way).
بۆ هەر ڕێگایەک هەڵدەبژێرن، بە : هەریەکەیان مەبەست لە دەدۆزێتەوە و دەداتە — دواتر — یان لەسەر دوایین دەیگەیەنێت (چۆن پاکێتێک ڕێگای خۆی دەدۆزێتەوە).
- Decapsulationهەڵوەشاندن
The destination host checks that the packet is for it, removes the IP header and hands the segment to the transport layer.
مەبەست دڵنیا دەبێتەوە کە بۆ ئەوە، لادەبات و دەداتە .
The IP packet: header + segmentپاکێتی IP: سەردێڕی پاکێت + بڕ
The transport layer hands down a segment — its own header plus the data. The network layer puts an IP header in front of it: IP header + transport-layer PDU = an IP packet, the network-layer PDU of every TCP/IP network. At each hop the data link layer then wraps the packet in a frame with a header and a trailer (Encapsulation and PDUs).
دەداتە خوارەوە — سەردێڕی خۆی لەگەڵ . دەخاتە پێشی: + = IP، کە لە هەموو TCP/IPـدا. لە هەر لە ناو دەپێچێتەوە بە سەر و (پێچانەوە و یەکەکانی دراوەی پرۆتۆکۆڵ).
Source and destination addressesناونیشانی سەرچاوە و مەبەست
Every IPv4 header carries a 32-bit source address and a 32-bit destination address. A laptop at 192.168.100.99 that asks a server at 172.16.3.10 for a page sends packets with source 192.168.100.99 and destination 172.16.3.10; the server’s replies swap the two. Routers read the destination address of every packet.
هەموو IPv4 دوو ناونیشانی 32 هەڵدەگرێت: ناونیشانی سەرچاوە و ناونیشانی مەبەست. لاپتۆپێک لە 192.168.100.99 کە داوای لاپەڕەیەک لە لە 172.16.3.10 دەکات، دەنێرێت بە سەرچاوە 192.168.100.99 و مەبەست 172.16.3.10؛ وەڵامەکانی ئەم دووانە ئاڵوگۆڕ دەکەن. ناونیشانی مەبەستی هەموو دەخوێننەوە.
IP addresses are logical and hierarchical. A MAC address only names a card on one link; an IP address also says which network the device is on — a network part and a host part, like a city, a street and a house number (IPv4 Addresses in Depth). That is why devices are grouped into networks — by building, department or purpose — and why routers keep routes to networks, not to every single host.
لۆجیکی و پلەبەندین. تەنیا ناوی کارتێک لەسەر یەک بەستەر دیاری دەکات؛ دەشڵێت ئامێرەکە لەسەر کام — و ، وەک شار، شەقام و ژمارەی ماڵ (ناونیشانەکانی IPv4 بە وردی). بۆیە ئامێرەکان لە چەند کۆ دەکرێنەوە — بەپێی باڵەخانە، بەش یان مەبەست — و ڕێگا بۆ هەڵدەگرن، نەک بۆ هەر بە تەنیا.
Connectionless: like posting a letterبێگرێدان: وەک ناردنی نامەیەک بە پۆستە
IPv4 is connectionless: nothing is set up before the packets are sent — the sender simply sends. It does not know whether the receiver is there, whether the packet arrived, or whether the receiver could read it; the receiver does not know when a packet is coming. Each packet travels on its own and may take a different path from the one before.
: پێش ناردنی هیچ شتێک ئامادە ناکرێت — نێرەر تەنیا دەنێرێت. نازانێت وەرگر لەوێیە یان نا، گەیشت یان نا، یان وەرگر توانی بیخوێنێتەوە یان نا؛ وەرگریش نازانێت کەی دێت. هەر بە تەنیا دەڕوات و لەوانەیە ڕێگایەکی جیاواز لە هی پێشووتر بگرێتەبەر.
Hana in Duhok posts a letter to her cousin in Halabja. She does not phone first: she writes the address on the envelope, drops it in the post box and walks away. The post moves it from sorting office to sorting office. Hana does not know when — or whether — it arrives, and a second letter posted the next day may travel another way. That is IP. A phone call, where both sides say hello first, is more like TCP (TCP Connections).
هانا لە دهۆکەوە نامەیەک بۆ ئامۆزاکەی لە هەڵەبجە دەنێرێت. پێشتر تەلەفۆن ناکات: ناونیشانەکە لەسەر زەرفەکە دەنووسێت، دەیخاتە سندووقی پۆستەوە و دەڕوات. پۆستە لە نووسینگەیەکەوە بۆ نووسینگەیەکی تر دەیگوازێتەوە. هانا نازانێت کەی دەگات — یان ئایا دەگات — و نامەیەکی دووەم کە ڕۆژی دواتر دەینێرێت لەوانەیە بە ڕێگایەکی تردا بڕوات. ئەمە . پەیوەندیی تەلەفۆن، کە هەردوو لا سەرەتا سڵاو دەکەن، زیاتر لە دەچێت (پەیوەندییەکانی TCP).
Where the analogy stops workingسنووری ئەم نموونەیە
A real post office tries hard and rarely loses letters; a router drops packets as soon as its queue is full, and leaves the checking to the end devices.
پۆستەی ڕاستەقینە زۆر هەوڵ دەدات و بە دەگمەن نامە ون دەکات؛ هەر کە پڕ بوو فڕێ دەدات و پشکنین بۆ جێ دەهێڵێت.
Best effort: no guaranteeگەیاندنی بەپێی توانا: بەبێ گەرەنتی
IPv4 is best effort, also called unreliable: IP has no way to manage, or to recover from, undelivered or damaged packets. Routers forward packets as fast as they can; when a queue overflows or a link fails, some packets are lost on the way — and IP sends no notice and no copy. Packets can also arrive twice or out of order.
بەکار دەهێنێت، کە پێی دەگوترێت ناپشتپێبەستراو (unreliable): هیچ ڕێگایەکی نییە بۆ بەڕێوەبردنی ئەو نەگەیشتوون یان تێکچوون، یان بۆ چاککردنەوەیان. بە خێراترین شێوە دەنێرنە پێشەوە؛ کاتێک پڕ دەبێت یان بەستەرێک دەپچڕێت، هەندێک لە ڕێگادا ون دەبن — و هیچ ئاگادارکردنەوە و هیچ کۆپییەک نانێرێت. دەشکرێت دوو جار بگەن یان بە ڕیزی جیاواز.
Other protocols do the tracking. TCP, above IP, numbers the data, waits for acknowledgements and sends missing data again; UDP does not, so a video call simply carries on after a lost packet. Keeping IP simple is a strength: routers do less work per packet, and the Internet keeps working when parts of it fail.
تر بەدواداچوون دەکەن. ، لە سەرووی ، ژمارە دەداتە ، چاوەڕێی وەڵامی گەیشتن دەکات و ئەوەی ون بووە دووپاتە دەینێرێتەوە؛ وا ناکات، بۆیە پەیوەندییەکی ڤیدیۆیی دوای ونبوونی هەر بەردەوام دەبێت. سادەیی خاڵی بەهێزە: بۆ هەر کاری کەمتر دەکەن و کاتێک بەشێکی تێکدەچێت هەر کار دەکات.
Media independent — but every link has an MTUسەربەخۆ لە هۆکاری گواستنەوە — بەڵام هەر بەستەرێک MTUـی هەیە
IP is media independent: the same packet can cross copper Ethernet, a serial line between routers, optical fibre and Wi-Fi on one trip, because IP does not care what carries it. Every link uses its own kind of frame; the packet inside stays the same.
سەربەخۆیە لە : هەمان دەتوانێت لە یەک گەشتدا بە ناو مس، هێڵێکی زنجیرەیی لە نێوان ، و تێپەڕێت، چونکە گرنگی نادات بەوەی چی هەڵیدەگرێت. هەر بەستەرێک جۆری خۆی بەکار دەهێنێت؛ ناوەوە وەک خۆی دەمێنێتەوە.
Media independent does not mean that any size goes. Every medium has a Maximum Transmission Unit (MTU) — the largest packet one frame can carry: 1,500 bytes on Ethernet, often 1,492 on a DSL line that uses PPPoE, and at least 1,280 on every IPv6 link. When a router must forward a packet onto a link with a smaller MTU, it may have to fragment it.
سەربەخۆیی لە واتای ئەوە نییە کە هەر قەبارەیەک دەگونجێت. هەموو خۆی هەیە (Maximum Transmission Unit): گەورەترین کە یەک دەتوانێت هەڵیبگرێت — 1,500 لە ، زۆرجار 1,492 لەسەر هێڵێکی کە PPPoE بەکار دەهێنێت؛ لانیکەمیش 1,280 لەسەر هەموو بەستەرێکی IPv6. کاتێک دەبێت بنێرێتە سەر بەستەرێک کە بچووکترە، لەوانەیە ناچار بێت پارچەی بکات ().
The IPv4 header, row by rowسەردێڕی پاکێتی IPv4، ڕیز بە ڕیز
Every IPv4 packet starts with a header of at least 20 bytes, drawn as five rows of 32 bits (4 bytes). Options can make it longer, up to 60 bytes, but they are rarely used. Read it row by row: row 1 says what this is and how big it is; row 2 is for fragments; row 3 keeps the packet alive, says what is inside and checks the header; rows 4 and 5 say where it comes from and where it goes.
هەموو IPv4 هەیە کە لانیکەم 20 و وەک پێنج ڕیزی 32 (4 ) دەکێشرێت. Options دەتوانن درێژتری بکەن تا 60 ، بەڵام بە دەگمەن بەکار دێن. ڕیز بە ڕیز بیخوێنەرەوە: ڕیزی 1 دەڵێت ئەمە چییە و چەند گەورەیە؛ ڕیزی 2 بۆ پارچەکانە؛ ڕیزی 3 زیندوو ڕادەگرێت، دەڵێت چی لە ناوەوەیە و سەردێڕەکە دەپشکنێت؛ ڕیزی 4 و 5 دەڵێن لە کوێوە هاتووە و بۆ کوێ دەچێت.
The IPv4 header, row by rowسەردێڕی پاکێتی IPv4، ڕیز بە ڕیز
Rows 1 and 2: version, length, service and fragmentsڕیزی 1 و 2: وەشان، درێژی، خزمەتگوزاری و پارچەکان
| Fieldخانە | Bits | What it doesچی دەکات |
|---|---|---|
| Version | 4 | 4 for IPv4 (6 for IPv6).4 بۆ IPv4 (6 بۆ IPv6). |
| IHL (Internet Header Length) | 4 | The header length in 32-bit words: 5 = 20 bytes, the smallest; 15 = 60 bytes, the largest.درێژیی سەردێڕەکە بە یەکەی 32 : 5 = 20 ، بچووکترین؛ 15 = 60 ، گەورەترین. |
| DSCP + ECN | 6 + 2 | DSCP marks the class of service — for example 46 for voice calls, so routers send them first; ECN lets a router signal congestion instead of dropping. Since 1998 (RFC 2474) and 2001 (RFC 3168) they replace the old ‘Type of Service’ byte.DSCP پلەی خزمەتگوزاری نیشان دەدات — بۆ نموونە 46 بۆ پەیوەندیی دەنگی، تا یەکەم جار ئەوان بنێرن؛ ECN ڕێگە دەدات لە جیاتی فڕێدان، قەرەباڵغی ڕابگەیەنێت. لە 1998ـەوە (RFC 2474) و 2001ـەوە (RFC 3168) جێی بایتی کۆنی ‘Type of Service’ دەگرنەوە. |
| Total Length | 16 | The whole packet, header + data, in bytes: at most 65,535.هەموو ، سەردێڕ + ، بە : زۆرترین 65,535. |
| Identification | 16 | A number the sender gives each packet; all fragments of one packet carry the same number.ژمارەیەکە کە نێرەر دەیداتە هەر ؛ هەموو پارچەکانی یەک هەمان ژمارە هەڵدەگرن. |
| Flags | 3 | Bit 0 reserved (always 0); DF = Don’t Fragment; MF = More Fragments follow. 0 تەرخانکراوە (هەمیشە 0)؛ DF = پارچەی مەکە (Don’t Fragment)؛ MF = پارچەی تر دێن (More Fragments). |
| Fragment Offset | 13 | Where this fragment’s data belongs in the original packet, counted in 8-byte units. ئەم پارچەیە لە کوێی سەرەکییەکەدایە، بە یەکەی 8 دەژمێردرێت. |
You will still meet the old name Type of Service (TOS) on diagrams and exam papers. Today that byte is DSCP (6 bits) + ECN (2 bits).
هێشتا ناوی کۆنی Type of Service (TOS) لەسەر هێڵکاری و پرسیاری تاقیکردنەوە دەبینیت. ئەمڕۆ ئەو بریتییە لە DSCP (6 ) + ECN (2 ).
The IPv4 header, row by rowسەردێڕی پاکێتی IPv4، ڕیز بە ڕیز
Rows 3 to 5: TTL, protocol, checksum and addressesڕیزی 3 تا 5: TTL، پرۆتۆکۆڵ، پشکنینی کۆ و ناونیشانەکان
| Fieldخانە | Bits | What it doesچی دەکات |
|---|---|---|
| Time to Live (TTL) | 8 | A hop limit: every router subtracts 1, and at 0 the packet is dropped.سنووری : هەر 1 کەم دەکاتەوە و لە 0دا فڕێ دەدرێت. |
| Protocol | 8 | What is inside: 1 = ICMP, 6 = TCP, 17 = UDP.چی لە ناوەوەیە: 1 = ICMP، 6 = TCP، 17 = UDP. |
| Header Checksum | 16 | An error check of the header only, not of the data. Every router checks it and computes it again, because the TTL has changed.پشکنینی هەڵەی سەردێڕەکە بە تەنیا، نەک . هەر دەیپشکنێت و دووپاتە حیسابی دەکاتەوە، چونکە TTL گۆڕاوە. |
| Source Address | 32 | The sender’s IP address. نێرەر. |
| Destination Address | 32 | The final receiver; routers read it at every hop.وەرگری کۆتایی؛ لە هەر دەیخوێننەوە. |
| Options + Padding | 0–320 | Extra services, rarely used; the padding fills the header up to a whole number of 32-bit words.خزمەتگوزاریی زیاتر، بە دەگمەن بەکار دێن؛ Padding سەردێڕەکە پڕ دەکاتەوە تا ببێتە لە یەکەی 32 . |
Worked example: reading a real headerنموونەی کارپێکراو: خوێندنەوەی سەردێڕێکی ڕاستەقینە
Here are the first 20 bytes of a ping packet as a capture program such as Wireshark shows them, in hexadecimal (two hex digits = one byte):
ئەمە یەکەم 20 وەک بەرنامەیەکی گرتنی ، وەک Wireshark، پیشانی دەدات، بە (دوو هێمای = یەک ):
45 00 00 3c 1c 46 00 00 80 01 32 36 c0 00 02 0a c6 33 64 07Decoded: version 4 with a 20-byte header; total length 60 bytes (20 of header + 40 of ICMP); identification 7238, not fragmented; TTL 128 — a Windows sender; protocol 1, so the data is ICMP; then the checksum and the two addresses. Each pair of hex digits is one byte: (hexadecimal to decimal).
شیکراوەکەی: وەشانی 4 بە سەردێڕێکی 20 ؛ درێژیی گشتی 60 (20 سەردێڕ + 40 ICMP)؛ Identification 7238، پارچە نەکراوە؛ TTL 128 — نێرەرێکی Windows؛ 1، بۆیە ICMPـە؛ پاشان و هەردوو ناونیشانەکە. هەر جووتە هێمایەکی یەک : (شانزەیی بۆ دەیی).
TTL: a packet’s hop limitTTL: سنووری باز بۆ پاکێت
Time to Live began as a time limit in seconds, but every router must subtract at least 1 — and in practice each router subtracts exactly 1, so TTL works as a hop limit. When the TTL reaches 0, the router throws the packet away and sends the sender an ICMP Time Exceeded message. Without TTL, a packet caught in a routing loop would circle for ever and use up the links.
(Time to Live) لە سەرەتادا سنووری کات بوو بە چرکە، بەڵام هەر دەبێت لانیکەم 1 کەم بکاتەوە — لە کرداریشدا هەر ڕێک 1 کەم دەکاتەوە، بۆیە TTL وەک سنووری کار دەکات. کاتێک TTL دەگاتە 0، فڕێ دەدات و پەیامی Time Exceededـی بۆ نێرەر دەنێرێت. بەبێ TTL، کە بکەوێتە ناو ئەڵقەیەکی ڕێدۆزییەوە بۆ هەمیشە دەسووڕایەوە و بەستەرەکانی پڕ دەکرد.
Senders start from different values: Linux, Android and macOS use 64 (the value IANA recommends), Windows uses 128, and many routers 255. So a reply with TTL=57 from a Linux server has probably crossed 7 routers (). Traceroute uses this rule on purpose (How tracert works). In the CêIT network lab, open ‘Three networks and two routers’ and ping across: the ‘What happened’ log shows each router lowering the TTL.
نێرەرەکان لە ژمارەی جیاوازەوە دەست پێ دەکەن: Linux، Android و macOS ژمارە 64 بەکار دەهێنن (ئەو ژمارەیەی پێشنیاری دەکات)، Windows ژمارە 128 و زۆرێک لە 255. کەواتە وەڵامێک بە TTL=57 لە Linuxـەوە بە ئەگەری زۆر لە 7 تێپەڕیوە (). بە ئەنقەست ئەم یاسایە بەکار دەهێنێت (بەدواداچوونی ڕێگە چۆن کار دەکات). لە تاقیگەی ڕایەڵەی CêIT نموونەی ‘سێ و دوو ’ بکەرەوە و بکە: بەشی ‘چی ڕوویدا’ نیشان دەدات کە هەر TTL کەم دەکاتەوە.


The protocol field: who gets the dataخانەی پرۆتۆکۆڵ: دراوە دەدرێتە کێ
At the destination, the network layer must pass the data to the right upper-layer protocol. The 8-bit protocol field says which one, with numbers kept by IANA: 1 = ICMP, 6 = TCP, 17 = UDP. Others you may meet: 2 IGMP (multicast groups), 41 an IPv6 packet carried inside IPv4, 47 GRE and 50 ESP (tunnels and VPNs), 89 OSPF (routers talking to each other). IPv6 calls the same field Next Header. What ICMP itself carries is explained in ICMP: the network layer’s messenger.
لە شوێنی مەبەستدا، دەبێت بداتە گونجاوی چینی سەرەوە. خانەی (8 ) دەڵێت کامیان، بە ژمارەگەلێک کە دەیانپارێزێت: 1 = ICMP، 6 = TCP، 17 = UDP. ژمارەکانی تر کە لەوانەیە ببینیت: 2 IGMP (گرووپەکانی )، 41 IPv6 لە ناو IPv4ـدا، 47 GRE و 50 ESP (تونێل و )، 89 OSPF ( کە قسە لەگەڵ یەکتر دەکەن). بە هەمان خانە دەڵێت Next Header. ئەوەی خۆی هەڵیدەگرێت لە ICMP: پەیامبەری چینی ڕایەڵەدا ڕوون کراوەتەوە.
Fragmentation: cutting a packet to fitپارچەکردنی پاکێت: بڕینی پاکێتێک تا جێی ببێتەوە
A 4,000-byte packet (20-byte header + 3,980 bytes of data) must cross an Ethernet link with an MTU of 1,500 bytes. The router cuts the data into pieces and gives each piece its own copy of the header: three fragments. All three keep the original Identification; the first two have MF = 1 (‘more fragments’), the last has MF = 0; the fragment offset says where each piece’s data starts, counted in 8-byte units: 0, 185 and 370.
4,000 (20 سەردێڕ + 3,980 ) دەبێت لە بەستەرێکی تێپەڕێت کە 1,500 . دەکات بە چەند پارچەیەک و کۆپییەکی سەردێڕەکە دەداتە هەر پارچەیەک: سێ پارچە (fragments). هەر سێکیان هەمان Identificationـی سەرەکی دەهێڵنەوە؛ دوو یەکەمیان MF = 1 (‘پارچەی تر هەیە’) و دواییەکەیان MF = 0؛ Fragment Offset دەڵێت هەر پارچەیەک لە کوێوە دەست پێ دەکات، بە یەکەی 8 دەژمێردرێت: 0، 185 و 370.
Routers never put fragments back together: only the destination host reassembles them, using the ID, the offsets and the MF flag — which costs it time and memory. If one fragment is lost, the whole packet is lost. If the Don’t Fragment (DF) flag is set, the router does not fragment at all: it drops the packet and sends back an ICMP ‘fragmentation needed’ message.
هەرگیز پارچەکان پێکەوە نانێنەوە: تەنیا مەبەست پێکیان دەهێنێتەوە، بە یارمەتیی ID، offsetـەکان و ئاڵای MF — ئەمەش کات و لە دەخوات. ئەگەر یەک پارچە ون بێت، هەموو ون دەبێت. ئەگەر ئاڵای Don’t Fragment (DF) دانرابێت، هیچ پارچەیەک ناکات: فڕێ دەدات و پەیامی ‘fragmentation needed’ـی دەگەڕێنێتەوە.


Fragmentation: cutting a packet to fitپارچەکردنی پاکێت: بڕینی پاکێتێک تا جێی ببێتەوە
Worked example: offsets in 8-byte unitsنموونەی کارپێکراو: offset بە یەکەی 8 بایت
A packet of 1,500 bytes (20 header + 1,480 data) must cross a link with an MTU of 520 bytes. Each fragment can carry at most data bytes, rounded down to a multiple of 8: 496. So the pieces carry 496 + 496 + 488 bytes:
1,500 (20 سەردێڕ + 1,480 ) دەبێت لە بەستەرێک تێپەڕێت کە 520 . هەر پارچەیەک دەتوانێت زۆرترین هەڵبگرێت، کە بۆ خوارەوە دەبرێت بۆ چەند هێندەیەکی 8: 496. کەواتە پارچەکان 496 + 496 + 488 هەڵدەگرن:
| Fragmentپارچە | Data bytes | Bytes of the original سەرەکی | Offset fieldخانەی offset | Total lengthدرێژیی گشتی | MFئاڵای MF |
|---|---|---|---|---|---|
| 1 | 496 | 0–495 | 0 | 516 | 1 |
| 2 | 496 | 496–991 | 62 | 516 | 1 |
| 3 | 488 | 992–1479 | 124 | 508 | 0 |
Avoiding fragmentation: path MTU discoveryدوورکەوتنەوە لە پارچەکردنی پاکێت: دۆزینەوەی MTUـی ڕێگا
Fragmentation is slow and fragile: firewalls often drop fragments, and one lost piece loses the whole packet — RFC 8900 (2020) advises new protocols not to rely on it. So today’s hosts try never to need it. With path MTU discovery (RFC 1191), the sender sets DF on its packets. A router that cannot forward one drops it and replies with ICMP ‘fragmentation needed’, giving the MTU of its next link; the sender then sends smaller packets. TCP keeps its segments small from the start: at most 1,460 bytes of data on Ethernet ().
خاو و ناسکە: زۆرجار پارچەکان فڕێ دەدەن و ونبوونی یەک پارچە هەموو ون دەکات — RFC 8900 (2020) ئامۆژگاری نوێ دەکات کە پشتی پێ نەبەستن. بۆیە ئەمڕۆ هەوڵ دەدەن هەرگیز پێویستیان پێی نەبێت. بە دۆزینەوەی ڕێگا (RFC 1191)، نێرەر DF لەسەر دادەنێت. کە نەتوانێت یەکێکیان بنێرێت، فڕێی دەدات و بە پەیامی ‘fragmentation needed’ـی وەڵام دەداتەوە، لەگەڵ بەستەری داهاتووی؛ پاشان نێرەر بچووکتر دەنێرێت. لە سەرەتاوە بچووک ڕادەگرێت: زۆرترین 1,460 لەسەر ().
A look ahead: the simpler IPv6 headerسەیرێکی پێشوەختە: سەردێڕی پاکێتی سادەتری IPv6
IPv6 (RFC 8200, 2017) kept what works and dropped the rest. Its header is always 40 bytes, with only eight fields: Version, Traffic Class (the same DSCP + ECN), Flow Label, Payload Length, Next Header (the protocol field), Hop Limit (the TTL, honestly renamed) and 128-bit source and destination addresses. Gone are the header length (the header is fixed), the header checksum (the link layer and TCP/UDP already check) and the fragmentation fields: routers never fragment IPv6 packets — only the sender may — and every link must carry at least 1,280 bytes. The addresses come in IPv6 Addresses.
IPv6 (RFC 8200، 2017) ئەوەی باش بوو هێشتیەوە و ئەوانی تری لابرد. هەمیشە 40 و تەنیا هەشت خانەی هەیە: Version، Traffic Class (هەمان DSCP + ECN)، Flow Label، Payload Length، Next Header (خانەی )، Hop Limit (هەمان TTL بە ناوێکی ڕاستگۆتر) و سەرچاوە و مەبەستی 128 . ئەمانە لابراون: درێژیی سەردێڕ (سەردێڕەکە جێگیرە)، سەردێڕ ( و TCP/UDP خۆیان دەپشکنن) و خانەکانی : هەرگیز IPv6 پارچە ناکەن — تەنیا نێرەر دەتوانێت — و هەموو بەستەرێک دەبێت لانیکەم 1,280 هەڵبگرێت. ناونیشانەکان لە ناونیشانەکانی IPv6 فێر دەکرێن.
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | What is trueڕاستییەکە |
|---|---|
| “IP works at the transport layer.”« لە کار دەکات.» | IP is the network-layer (internet-layer) protocol; TCP and UDP are the transport layer. (چینی ئینتەرنێت)؛ و . |
| “Best effort means IP is bad.”« واتە خراپە.» | It means no guarantee: IP stays simple and fast, and TCP above it adds reliability when needed.واتە بەبێ گەرەنتی: سادە و خێرا دەمێنێتەوە و لە سەرەوەی، کاتێک پێویست بێت، زیاد دەکات. |
| “Media independent means a packet can be any size.”«سەربەخۆ لە واتە دەتوانێت هەر قەبارەیەکی هەبێت.» | Every link has an MTU (Ethernet 1,500 bytes); bigger packets are fragmented or avoided.هەر بەستەرێک هەیە ( 1,500 )؛ گەورەتر پارچە دەکرێت یان خۆی لێ لادەدرێت. |
| “The header checksum protects the data.”« سەردێڕ دەپارێزێت.» | It covers the header only; TCP/UDP checksums and the Ethernet FCS check the rest.تەنیا سەردێڕەکە دەگرێتەوە؛ TCP/UDP و FCSـی ئەوانی تر دەپشکنن. |
| “TTL counts seconds.”«TTL چرکە دەژمێرێت.» | In practice it counts hops: each router subtracts 1.لە کرداردا دەژمێرێت: هەر 1 کەم دەکاتەوە. |
| “Routers put fragments back together.”« پارچەکان پێکەوە دەنێنەوە.» | Only the destination host reassembles them.تەنیا مەبەست پێکیان دەهێنێتەوە. |
| “Fragments can have any size, such as 500 bytes.”«پارچەکان دەکرێت هەر قەبارەیەکیان هەبێت، وەک 500 .» | Every fragment but the last carries a multiple of 8 data bytes, because offsets count 8-byte units.هەموو پارچەیەک جگە لە دواییەکەیان چەند هێندەیەکی 8 هەڵدەگرێت، چونکە offset یەکەی 8 دەژمێرێت. |
| “The second byte is the Type of Service.”« دووەم Type of Serviceـە.» | Since 1998 it is DSCP (6 bits) + ECN (2 bits).لە 1998ـەوە بریتییە لە DSCP (6 ) + ECN (2 ). |
| “Protocol 6 is UDP.”« 6 UDPـە.» | 6 = TCP, 17 = UDP, 1 = ICMP.6 = TCP، 17 = UDP، 1 = ICMP. |
Exercisesڕاهێنانەکان
A 2,400-byte IPv4 packet (20-byte header) must cross a link with an MTU of 1,000 bytes. For each fragment give the data bytes, the offset field, the total length and MF.
2,400 IPv4 (سەردێڕی 20 ) دەبێت لە بەستەرێک تێپەڕێت کە 1,000 . بۆ هەر پارچەیەک ، خانەی offset، درێژیی گشتی و MF بنووسە.
Hintئاماژە
Subtract the header, round down to a multiple of 8, and divide each start byte by 8.
سەردێڕەکە لابە، بۆ خوارەوە بۆ چەند هێندەیەکی 8 ببە و هەر دەستپێک دابەش بە 8 بکە.
Show answerوەڵامەکە پیشان بدە
Data per fragment: , rounded down to a multiple of 8 = 976. The data is bytes = 976 + 976 + 428.
بۆ هەر پارچەیەک: ، بۆ خوارەوە بۆ چەند هێندەیەکی 8 = 976. = 976 + 976 + 428.
| Fragmentپارچە | Data bytes | Offsetخانەی Offset | Total lengthدرێژیی گشتی | MFئاڵای MF |
|---|---|---|---|---|
| 1 | 976 (0–975) | 0 | 996 | 1 |
| 2 | 976 (976–1951) | 122 | 996 | 1 |
| 3 | 428 (1952–2379) | 244 | 448 | 0 |
A ping reply from a Linux server shows TTL=57. About how many routers lie between you and the server? Why only ‘about’?
وەڵامی لە Linuxـەوە TTL=57 نیشان دەدات. نزیکەی چەند لە نێوان تۆ و ؟ بۆچی تەنیا ‘نزیکەی’؟
Show answerوەڵامەکە پیشان بدە
Linux starts at 64, so routers. Only ‘about’, because the starting value is a guess from the operating system, and the way back can differ from the way there.
Linux لە 64ـەوە دەست پێ دەکات، بۆیە . تەنیا ‘نزیکەی’، چونکە ژمارەی دەستپێک تەنیا مەزەندەیە لە و ڕێگای گەڕانەوە دەکرێت جیاواز بێت لە ڕێگای چوون.
A header starts with the bytes 45 00 05 dc and its tenth byte is 06. What do you know about this packet?
سەردێڕێک بەم دەست پێ دەکات: 45 00 05 dc و دەیەمی 06ـە. چی لەبارەی ئەم دەزانیت؟
Show answerوەڵامەکە پیشان بدە
- 4 = IPv4; IHL 5 = a 20-byte header without options.
- 00 = DSCP 0 and ECN 0: ordinary traffic.
- 05 dc = : a full-size Ethernet packet.
- 06 in the protocol field = TCP.
- 4 = IPv4؛ IHL 5 = سەردێڕێکی 20 بەبێ Options.
- 00 = DSCP 0 و ECN 0: هاتوچۆی ئاسایی.
- 05 dc = : تەواوقەبارەی .
- 06 لە خانەی = TCP.
What are the three basic characteristics of IPv4?سێ تایبەتمەندیی بنەڕەتیی IPv4 چین؟
Connectionless (no set-up before sending), best effort (no delivery guarantee) and media independent (any medium, within each link’s MTU).
(بەبێ ئامادەکاری پێش ناردن)، (بەبێ گەرەنتیی گەیاندن) و سەربەخۆ لە (هەر ، لە سنووری هەر بەستەرێکدا).
What does the protocol field do?خانەی پرۆتۆکۆڵ چی دەکات؟
It tells the destination which upper-layer protocol gets the data: 1 ICMP, 6 TCP, 17 UDP.
بە مەبەست دەڵێت بدرێتە کام چینی سەرەوە: 1 ICMP، 6 TCP، 17 UDP.
Why do modern hosts avoid IP fragmentation?بۆچی میوانگرەکانی نوێ خۆیان لە پارچەکردنی پاکێت لادەدەن؟
It costs time, firewalls often drop fragments, and one lost fragment loses the whole packet; path MTU discovery and TCP’s segment size avoid it.
کاتی دەوێت، زۆرجار پارچەکان فڕێ دەدەن و ونبوونی یەک پارچە هەموو ون دەکات؛ دۆزینەوەی ڕێگا و قەبارەی ڕێگری لێ دەکەن.
Summaryپوختە
- The network layer (OSI 3, TCP/IP internet layer) carries packets end to end; its protocol is IP (IPv4, IPv6), helped by ICMP and ARP.
- Four jobs: addressing, encapsulation (IP header + segment = packet), routing hop by hop, decapsulation.
- IPv4 is connectionless (like a posted letter), best effort (TCP adds reliability) and media independent — but every link has an MTU (Ethernet 1,500 bytes).
- The header is 20 bytes (up to 60): version, IHL, DSCP/ECN (ex-TOS), total length, ID, flags, offset, TTL, protocol (1 ICMP, 6 TCP, 17 UDP), header checksum, source and destination.
- TTL is a hop limit: at 0 the packet is dropped and ICMP Time Exceeded goes back.
- Fragments carry multiples of 8 data bytes, share one ID and are rebuilt only by the destination host; path MTU discovery avoids them; IPv6 routers never fragment.
- (چینی 3ی OSI، چینی ئینتەرنێتی TCP/IP) لە سەرێکەوە بۆ سەرەکەی تر دەگەیەنێت؛ (IPv4، IPv6)، بە یارمەتیی و .
- چوار ئەرک: ناونیشانکردن، ( + = )، بە ، .
- (وەک نامەیەکی پۆستە)، بەکار دەهێنێت ( زیاد دەکات) و سەربەخۆیە لە — بەڵام هەر بەستەرێک هەیە ( 1,500 ).
- سەردێڕەکە 20 (تا 60): Version، IHL، DSCP/ECN (TOSـی جاران)، Total Length، ID، Flags، Offset، TTL، (1 ICMP، 6 TCP، 17 UDP)، سەردێڕ، سەرچاوە و مەبەست.
- TTL سنووری : لە 0دا فڕێ دەدرێت و Time Exceededـی دەگەڕێتەوە.
- پارچەکان چەند هێندەیەکی 8 هەڵدەگرن، یەک ID هاوبەش دەکەن و تەنیا مەبەست دووپاتە دروستیان دەکاتەوە؛ دۆزینەوەی ڕێگا ڕێگرییان لێ دەکات؛ IPv6 هەرگیز پارچە ناکەن.
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
IPv4 Addresses in Depthناونیشانەکانی IPv4 بە وردی
Related lecturesوانە پەیوەندیدارەکان
- IPv4 Addresses in Depthناونیشانەکانی IPv4 بە وردی
- ICMP, Ping and TracerouteICMP، پینگ و بەدواداچوونی ڕێگە
- ARP: From IP Address to MAC AddressARP: لە ناونیشانی IP بۆ ناونیشانی MAC
- How a Packet Finds Its Way: Gateways and Routing Tablesپاکێت چۆن ڕێگای خۆی دەدۆزێتەوە: دەروازەی بنەڕەتی و خشتەکانی ڕێدۆزی
- TCP and UDPTCP و UDP
- Inside a TCP Connection: Handshake, Windows and Reliabilityناو پەیوەندییەکی TCP: سێ ڕێی تەوقەکردن، پەنجەرەکان و پشتپێبەستراوی
- IPv6 Addresses: Format and Typesناونیشانەکانی IPv6: شێوە و جۆرەکان
- MAC Addresses and Ethernet Framesناونیشانەکانی MAC و فرەیمەکانی Ethernet
- Collision Domains and Broadcast Domainsپاوانەکانی پێکدادان و پاوانەکانی پەخش
- IP Addresses and MAC Addressesناونیشانەکانی IP و ناونیشانەکانی MAC
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- RFC 791 (STD 5, 1981): Internet Protocol — header format, fragmentation in 8-octet units, TTL, connectionless and unreliable service
- RFC 2474 (1998): Definition of the Differentiated Services Field (DS Field) — supersedes the IPv4 TOS octet
- RFC 3168 (2001): The Addition of Explicit Congestion Notification (ECN) to IP — bits 6–7 of the old TOS octet
- IANA: Assigned Internet Protocol Numbers (1 ICMP, 6 TCP, 17 UDP, 41 IPv6, 47 GRE, 50 ESP, 89 OSPF)
- IANA: IP Parameters — recommended default TTL 64
- Linux kernel documentation: IP sysctl — ip_default_ttl 64
- Microsoft Learn (archive): TCP/IP Configuration Parameters — DefaultTTL 128
- RFC 1191 (1990): Path MTU Discovery
- RFC 8900 (BCP 230, 2020): IP Fragmentation Considered Fragile
- RFC 2516 (1999): PPP over Ethernet — MRU at most 1492
- RFC 8200 (STD 86, 2017): Internet Protocol, Version 6 — fixed header, Hop Limit, minimum MTU 1280, fragmentation only at the source
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.