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 ، دۆزینەوەی ڕێگا و سەیرێکی سەرەتایی سادەتری .

20 min read23 خولەک خوێندنەوە · 20 stepsهەنگاو

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دایە.

The OSI model (7 layers) beside the TCP/IP model (application, transport, internet, network access). OSI layer 3, network, and the TCP/IP internet layer are framed together and point to a box ‘IPv4 · IPv6’. Above it ‘TCP · UDP’, below it ‘Ethernet · Wi-Fi’. A side box: IP’s helpers at layer 3 — ICMP for errors and ping, ARP to find the MAC address; history: IPX, AppleTalk, DECnet.مۆدێلی OSI (7 چین) لە تەنیشت مۆدێلی TCP/IP (ئەپ، گواستنەوە، ئینتەرنێت، گەیشتن بە ڕایەڵە). چینی 3ی OSI (چینی ڕایەڵە) و چینی ئینتەرنێتی TCP/IP پێکەوە لە چوارچێوەیەکدان و ئاماژە بۆ سندووقێک دەکەن: ‘IPv4 · IPv6’. لە سەرەوەی ‘TCP · UDP’ و لە خوارەوەی ‘Ethernet · Wi-Fi’. سندووقێکی لاتەنیشت: یاریدەدەرانی IP لە چینی 3 — ICMP بۆ هەڵە و پینگ، ARP بۆ دۆزینەوەی ناونیشانی MAC؛ مێژوو: IPX، AppleTalk، DECnet.
IP is the protocol of layer 3 — the internet layer of TCP/IP. چینی 3یە — چینی ئینتەرنێتی ⁦TCP/IP⁩.CêIT

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 بە ناو سێ ڕێدۆزدا).

  1. Addressingناونیشانکردن

    Every end device gets an IP address: a logical address that also says which network the device is on.

    هەر وەردەگرێت: ناونیشانێکی لۆجیکی کە دەشڵێت ئامێرەکە لەسەر کام .

  2. Encapsulationپێچانەوە

    The sending host puts the transport-layer segment inside a packet, whose header holds the source and destination IP addresses.

    نێرەر دەخاتە ناو کە سەرچاوە و مەبەست هەڵدەگرێت.

  3. 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).

    بۆ هەر ڕێگایەک هەڵدەبژێرن، بە : هەریەکەیان مەبەست لە دەدۆزێتەوە و دەداتە — دواتر — یان لەسەر دوایین دەیگەیەنێت (چۆن پاکێتێک ڕێگای خۆی دەدۆزێتەوە).

  4. Decapsulationهەڵوەشاندن

    The destination host checks that the packet is for it, removes the IP header and hands the segment to the transport layer.

    مەبەست دڵنیا دەبێتەوە کە بۆ ئەوە، لادەبات و دەداتە .

Host A, a laptop at 192.0.2.10, sends through routers R1 and R2 to host B, a server at 198.51.100.7. Box 1, Addressing: every host gets an IP address. Box 2, Encapsulation: segment + IP header = packet. Box 3, Routing, pointing at both routers: each router picks the next hop. Box 4, Decapsulation, at host B: B removes the header.میوانگر A، لاپتۆپێک لە 192.0.2.10، بە ناو R1 و R2دا بۆ میوانگر B دەنێرێت، ڕاژەکارێک لە 198.51.100.7. سندووقی 1، ناونیشانکردن: هەر میوانگرێک ناونیشانی IPـێک وەردەگرێت. سندووقی 2، پێچانەوە: بڕ + سەردێڕی پاکێت = پاکێت. سندووقی 3، ڕێدۆزی، کە ئاماژە بۆ هەردوو ڕێدۆزەکە دەکات: هەر ڕێدۆزێک بازی دواتر هەڵدەبژێرێت. سندووقی 4، هەڵوەشاندن، لای B: B سەردێڕی پاکێت لادەبات.
Address and wrap at the sender, route in the middle, unwrap at the receiver.ناونیشان و پێچانەوە لای نێرەر، لە ناوەڕاست، کردنەوە لای وەرگر.CêIT

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⁩ـدا. لە هەر لە ناو دەپێچێتەوە بە سەر و (پێچانەوە و یەکەکانی دراوەی پرۆتۆکۆڵ).

Four rows, each built from the one above. Application data. A segment: TCP header + data. A packet: IP header + TCP header + data, framed and labelled ‘packet’. A frame: frame header + IP header + TCP header + data + trailer. The PDU names segment, packet and frame are written on the right.چوار ڕیز، هەریەکەیان لەسەر ڕیزی سەرەوەی دروست کراوە. دراوەی ئەپ. بڕ: سەردێڕی TCP + دراوە. پاکێت: سەردێڕی پاکێت + سەردێڕی TCP + دراوە، لە چوارچێوەیەکدا و بە ناوی ‘پاکێت’. فرەیم: سەری فرەیم + سەردێڕی پاکێت + سەردێڕی TCP + دراوە + پاشکۆی فرەیم. ناوەکانی PDU — بڕ، پاکێت و فرەیم — لە لای ڕاست نووسراون.
The network layer adds the IP header; the data link layer adds the frame around it. زیاد دەکات؛ بە دەوریدا زیاد دەکات.CêIT

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 بە وردی). بۆیە ئامێرەکان لە چەند کۆ دەکرێنەوە — بەپێی باڵەخانە، بەش یان مەبەست — و ڕێگا بۆ هەڵدەگرن، نەک بۆ هەر بە تەنیا.

A laptop at 192.168.100.99 and a server at 172.16.3.10. A blue request arrow goes right: source 192.168.100.99 → destination 172.16.3.10. A purple reply arrow goes left: source 172.16.3.10 → destination 192.168.100.99. Below, part of an IPv4 header with the source address and destination address rows (32 bits each) highlighted.لاپتۆپێک لە 192.168.100.99 و ڕاژەکارێک لە 172.16.3.10. تیرێکی شینی داواکاری بەرەو ڕاست: سەرچاوە 192.168.100.99، مەبەست 172.16.3.10. تیرێکی مۆری وەڵام بەرەو چەپ: سەرچاوە 172.16.3.10، مەبەست 192.168.100.99. لە خوارەوە، بەشێک لە سەردێڕی پاکێتی IPv4 کە ڕیزەکانی ناونیشانی سەرچاوە و ناونیشانی مەبەست (هەریەکە 32 بیت) ڕەنگ کراون.
The reply swaps source and destination.وەڵامەکە سەرچاوە و مەبەست ئاڵوگۆڕ دەکات.CêIT

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.

: پێش ناردنی هیچ شتێک ئامادە ناکرێت — نێرەر تەنیا دەنێرێت. نازانێت وەرگر لەوێیە یان نا، گەیشت یان نا، یان وەرگر توانی بیخوێنێتەوە یان نا؛ وەرگریش نازانێت کەی دێت. هەر بە تەنیا دەڕوات و لەوانەیە ڕێگایەکی جیاواز لە هی پێشووتر بگرێتەبەر.

Posting a letter from Duhokناردنی نامەیەک لە دهۆکەوە

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).

An envelope addressed ‘to: Halabja’ next to the words ‘no phone call first: just write the address and post it’. Below, four boxes joined by arrows: Duhok (post box), Erbil (sorting office), Sulaymaniyah (sorting office) and Halabja (cousin’s house). A dashed purple curve from Duhok to Halabja: letter 2 may take another way, via Kirkuk. Bottom line: Hana does not know when — or whether — it arrives.زەرفێک بە ناونیشانی ‘بۆ: هەڵەبجە’ لە تەنیشت ئەم ڕستەیە: ‘پێشتر هیچ تەلەفۆنێک نییە: تەنیا ناونیشانەکە بنووسە و بینێرە’. لە خوارەوە چوار سندووق بە تیر بەیەکەوە بەستراون: دهۆک (سندووقی پۆستە)، هەولێر (نووسینگەی پۆستە)، سلێمانی (نووسینگەی پۆستە) و هەڵەبجە (ماڵی ئامۆزا). کەوانەیەکی مۆری پچڕپچڕ لە دهۆکەوە بۆ هەڵەبجە: نامەی 2 لەوانەیە بە ڕێگایەکی تردا بڕوات، لە ڕێی کەرکووکەوە. هێڵی خوارەوە: هانا نازانێت کەی دەگات — یان ئایا دەگات.
No connection first: every letter — every packet — travels on its own.سەرەتا هیچ پەیوەندییەک نییە: هەر نامەیەک — هەر — بە تەنیا دەڕوات.CêIT
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.

تر بەدواداچوون دەکەن. ، لە سەرووی ، ژمارە دەداتە ، چاوەڕێی وەڵامی گەیشتن دەکات و ئەوەی ون بووە دووپاتە دەینێرێتەوە؛ وا ناکات، بۆیە پەیوەندییەکی ڤیدیۆیی دوای ونبوونی هەر بەردەوام دەبێت. سادەیی خاڵی بەهێزە: بۆ هەر کاری کەمتر دەکەن و کاتێک بەشێکی تێکدەچێت هەر کار دەکات.

A sender and a receiver joined through a cloud of four routers. Packets 1, 2 and 3 leave the sender; packet 2 is crossed out inside the cloud, ‘lost when a queue overflows’; packets 1 and 3 arrive. A dashed purple arrow from the receiver back to the sender: TCP at the receiver says ‘2 is missing’ and the sender sends 2 again. Bottom line: IP itself sends no warning and no copy.نێرەر و وەرگر بە ناو هەورێکی چوار ڕێدۆزیدا بەیەکەوە بەستراون. پاکێتی 1، 2 و 3 لە نێرەرەوە دەردەچن؛ پاکێتی 2 لە ناو هەورەکەدا خەتی بەسەردا هاتووە، ‘ون بوو کاتێک کیوو پڕ بوو’؛ پاکێتی 1 و 3 دەگەن. تیرێکی مۆری پچڕپچڕ لە وەرگرەوە بۆ نێرەر: TCP لای وەرگر دەڵێت ‘2 ون بووە’ و نێرەر 2 دووپاتە دەنێرێتەوە. هێڵی خوارەوە: IP خۆی هیچ ئاگادارکردنەوە و هیچ کۆپییەک نانێرێت.
IP loses packets without a word; TCP notices and asks again. بێدەنگ ون دەکات؛ ئاگای لێ دەبێت و دووپاتە داوا دەکاتەوە.CêIT

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⁩. کاتێک دەبێت بنێرێتە سەر بەستەرێک کە بچووکترە، لەوانەیە ناچار بێت پارچەی بکات ().

A home PC, a home router, an ISP router, an office router and a laptop in a row. The links between them: copper Ethernet with MTU 1500, a DSL line with PPPoE with MTU 1492, optical fibre with MTU 1500 and Wi-Fi with MTU 1500. One ‘IP packet’ tag rides along. Text: IP does not care what carries it, but the biggest packet each link can carry differs.کۆمپیوتەری ماڵەوە، ڕێدۆزی ماڵەوە، ڕێدۆزی دابینکەری ئینتەرنێت، ڕێدۆزی ئۆفیس و لاپتۆپێک لە ڕیزێکدا. بەستەرەکانی نێوانیان: Ethernetـی مس بە MTU 1500، هێڵی DSL بە PPPoE و MTU 1492، کێبڵی فایبەر ئۆپتیک بە MTU 1500 و وای‌فای بە MTU 1500. یەک نیشانەی ‘پاکێتی IP’ لەگەڵیاندا دەڕوات. نووسین: IP گرنگی نادات بەوەی چی هەڵیدەگرێت، بەڵام گەورەترین پاکێت کە هەر بەستەرێک هەڵیدەگرێت جیاوازە.
Same packet, different media — and a different MTU on each link.هەمان ، جیاواز — و جیاواز لەسەر هەر بەستەرێک.CêIT

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 as a grid with a bit ruler 0 to 31. Row 1: Version (4 bits), IHL (4), DSCP (6), ECN (2), Total Length (16). Row 2: Identification (16), Flags (3), Fragment Offset (13). Row 3: Time to Live (8), Protocol (8), Header Checksum (16). Row 4: Source Address (32). Row 5: Destination Address (32). A bracket marks these five rows as 20 bytes, always. Then a dashed row of Options (only if IHL > 5) and Padding, 0–40 bytes, and a dashed row of Data, for example a TCP segment.سەردێڕی پاکێتی IPv4 وەک تۆڕێک لەگەڵ ڕاستەیەکی بیت لە 0 تا 31. ڕیزی 1: Version (4 بیت)، IHL (4)، DSCP (6)، ECN (2)، Total Length (16). ڕیزی 2: Identification (16)، Flags (3)، Fragment Offset (13). ڕیزی 3: Time to Live (8)، Protocol (8)، Header Checksum (16). ڕیزی 4: Source Address (32). ڕیزی 5: Destination Address (32). کەوانەیەک ئەم پێنج ڕیزە وەک 20 بایت نیشان دەدات، هەمیشە. پاشان ڕیزێکی پچڕپچڕی Options (تەنیا ئەگەر IHL > 5) و Padding، 0–40 بایت؛ پاشان ڕیزێکی پچڕپچڕی دراوە، بۆ نموونە بڕێکی TCP.
Five rows of 4 bytes: the 20-byte IPv4 header.پێنج ڕیزی 4 : ⁦20⁩ ⁦IPv4⁩.CêIT

The IPv4 header, row by rowسەردێڕی پاکێتی ⁦IPv4⁩، ڕیز بە ڕیز

Rows 1 and 2: version, length, service and fragmentsڕیزی 1 و 2: وەشان، درێژی، خزمەتگوزاری و پارچەکان

FieldخانەBitsWhat it doesچی دەکات
Version44 for IPv4 (6 for IPv6).4 بۆ ⁦IPv4 (6⁩ بۆ ⁦IPv6⁩).
IHL (Internet Header Length)4The header length in 32-bit words: 5 = 20 bytes, the smallest; 15 = 60 bytes, the largest.درێژیی سەردێڕەکە بە یەکەی ⁦32⁩ : ⁦5 = 20⁩ ، بچووکترین؛ ⁦15 = 60⁩ ، گەورەترین.
DSCP + ECN6 + 2DSCP 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 Length16The whole packet, header + data, in bytes: at most 65,535.هەموو ، سەردێڕ + ، بە : زۆرترین ⁦65,535⁩.
Identification16A number the sender gives each packet; all fragments of one packet carry the same number.ژمارەیەکە کە نێرەر دەیداتە هەر ؛ هەموو پارچەکانی یەک هەمان ژمارە هەڵدەگرن.
Flags3Bit 0 reserved (always 0); DF = Don’t Fragment; MF = More Fragments follow. 0 تەرخانکراوە (هەمیشە ⁦0⁩)؛ DF = پارچەی مەکە (Don’t Fragment)؛ MF = پارچەی تر دێن ⁦(More Fragments)⁩.
Fragment Offset13Where 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خانەBitsWhat it doesچی دەکات
Time to Live (TTL)8A hop limit: every router subtracts 1, and at 0 the packet is dropped.سنووری : هەر 1 کەم دەکاتەوە و لە 0دا فڕێ دەدرێت.
Protocol8What is inside: 1 = ICMP, 6 = TCP, 17 = UDP.چی لە ناوەوەیە: ⁦1 = ICMP⁩، ⁦6 = TCP⁩، ⁦17 = UDP⁩.
Header Checksum16An 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 Address32The sender’s IP address. نێرەر.
Destination Address32The final receiver; routers read it at every hop.وەرگری کۆتایی؛ لە هەر دەیخوێننەوە.
Options + Padding0–320Extra 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، پیشانی دەدات، بە (دوو هێمای = یەک ):

The first 20 bytes of the packetیەکەم ⁦20⁩ بایتی پاکێتەکەTEXT
45 00 00 3c 1c 46 00 00 80 01 32 36 c0 00 02 0a c6 33 64 07
The 20 bytes laid out in the five header rows, each with its meaning. 45: version 4, IHL 5 = 20 bytes. 00: DSCP 0, ECN 0. 00 3c: total length 60 bytes. 1c 46: identification 7238. 00 00: DF 0, MF 0, offset 0. 80: TTL 128. 01: protocol 1 = ICMP. 32 36: header checksum. c0 00 02 0a: source 192.0.2.10. c6 33 64 07: destination 198.51.100.7.20 بایتەکە لە پێنج ڕیزی سەردێڕەکەدا ڕیز کراون، هەریەکە بە واتاکەیەوە. 45: وەشانی 4، IHL 5 = 20 بایت. 00: DSCP 0، ECN 0. 00 3c: درێژیی گشتی 60 بایت. 1c 46: Identification 7238. 00 00: DF 0، MF 0، offset 0. 80: TTL 128. 01: پرۆتۆکۆڵ 1 = ICMP. 32 36: پشکنینی کۆ. c0 00 02 0a: سەرچاوە 192.0.2.10. c6 33 64 07: مەبەست 198.51.100.7.
Every field of a real ping packet, decoded.هەموو خانەکانی ڕاستەقینەی ، شیکراوە.CêIT

Decoded: 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: c016=12×16+0=192\text{c0}_{16} = 12 \times 16 + 0 = 192 (hexadecimal to decimal).

شیکراوەکەی: وەشانی 4 بە سەردێڕێکی ⁦20⁩ ؛ درێژیی گشتی ⁦60⁩ (⁦20⁩ سەردێڕ + ⁦40 ICMP⁩)؛ ⁦Identification 7238⁩، پارچە نەکراوە؛ ⁦TTL 128⁩ — نێرەرێکی Windows؛ 1، بۆیە ICMPـە؛ پاشان و هەردوو ناونیشانەکە. هەر جووتە هێمایەکی یەک : c016=12×16+0=192\text{c0}_{16} = 12 \times 16 + 0 = 192 (شانزەیی بۆ دەیی).

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 (64−57=764 - 57 = 7). 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 تێپەڕیوە (64−57=764 - 57 = 7). بە ئەنقەست ئەم یاسایە بەکار دەهێنێت (بەدواداچوونی ڕێگە چۆن کار دەکات). لە تاقیگەی ڕایەڵەی CêIT نموونەی ‘سێ و دوو ’ بکەرەوە و بکە: بەشی ‘چی ڕوویدا’ نیشان دەدات کە هەر TTL کەم دەکاتەوە.

Animation in six steps on a path PC1 – R1 – R2 – R3 – server. 1: PC1 sends a packet with TTL 64. 2: R1 lowers it to 63. 3: R2 lowers it to 62. 4: R3 lowers it to 61 and the packet arrives. 5: a routing loop — R2 and R3 pass a packet back and forth, TTL 3, 2, 1. 6: the TTL reaches 0 at R3; the packet is dropped and an ICMP ‘time exceeded’ message goes back to PC1, the message that traceroute uses.
Animation in six steps on a path PC1 – R1 – R2 – R3 – server. 1: PC1 sends a packet with TTL 64. 2: R1 lowers it to 63. 3: R2 lowers it to 62. 4: R3 lowers it to 61 and the packet arrives. 5: a routing loop — R2 and R3 pass a packet back and forth, TTL 3, 2, 1. 6: the TTL reaches 0 at R3; the packet is dropped and an ICMP ‘time exceeded’ message goes back to PC1, the message that traceroute uses.
Each router subtracts 1; at 0 the packet dies.هەر 1 کەم دەکاتەوە؛ لە 0دا کۆتایی پێ دێت.CêIT

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: پەیامبەری چینی ڕایەڵەدا ڕوون کراوەتەوە.

An IPv4 header box asking ‘Protocol = ?’ with three arrows down to three boxes: 1 → ICMP (ping, error messages), 6 → TCP (web pages, e-mail), 17 → UDP (DNS, video calls). Below: other numbers 2 IGMP, 41 IPv6 inside IPv4, 47 GRE, 50 ESP, 89 OSPF; IANA keeps the list, and IPv6 calls the field Next Header.سندووقی سەردێڕی پاکێتی IPv4 کە دەپرسێت ‘Protocol = ?’ و سێ تیر بەرەو سێ سندووق: 1 ← ICMP (پینگ، پەیامی هەڵە)، 6 ← TCP (لاپەڕەی وێب، ئیمەیڵ)، 17 ← UDP (DNS، پەیوەندیی ڤیدیۆیی). لە خوارەوە: ژمارەکانی تر 2 IGMP، 41 IPv6 لە ناو IPv4، 47 GRE، 50 ESP، 89 OSPF؛ IANA لیستەکە دەپارێزێت و IPv6 بە خانەکە دەڵێت Next Header.
One number tells the receiver which protocol to hand the data to.یەک ژمارە بە وەرگر دەڵێت بداتە کام .CêIT

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’ـی دەگەڕێنێتەوە.

Animation in six steps. 1: a 4,000-byte packet, IP header + 3,980 data bytes with ID 4321, reaches a router whose next link has MTU 1500. 2: each fragment can carry 1500 − 20 = 1480 data bytes, and 1480 ÷ 8 = 185. 3: fragment 1, bytes 0–1479, offset 0, MF 1, total 1500 bytes. 4: fragment 2, bytes 1480–2959, offset 185, MF 1, total 1500. 5: fragment 3, bytes 2960–3979, offset 370, MF 0, total 1040. 6: the destination host uses the same ID and orders the pieces by offset to rebuild the 3,980 bytes.
Animation in six steps. 1: a 4,000-byte packet, IP header + 3,980 data bytes with ID 4321, reaches a router whose next link has MTU 1500. 2: each fragment can carry 1500 − 20 = 1480 data bytes, and 1480 ÷ 8 = 185. 3: fragment 1, bytes 0–1479, offset 0, MF 1, total 1500 bytes. 4: fragment 2, bytes 1480–2959, offset 185, MF 1, total 1500. 5: fragment 3, bytes 2960–3979, offset 370, MF 0, total 1040. 6: the destination host uses the same ID and orders the pieces by offset to rebuild the 3,980 bytes.
Three fragments, one ID; only the destination puts them together.سێ پارچە، یەک ID؛ تەنیا مەبەست پێکیان دەهێنێتەوە.CêIT

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 520−20=500520 - 20 = 500 data bytes, rounded down to a multiple of 8: 496. So the pieces carry 496 + 496 + 488 bytes:

⁦1,500⁩ (⁦20⁩ سەردێڕ + ⁦1,480⁩ ) دەبێت لە بەستەرێک تێپەڕێت کە ⁦520⁩ . هەر پارچەیەک دەتوانێت زۆرترین 520−20=500520 - 20 = 500 هەڵبگرێت، کە بۆ خوارەوە دەبرێت بۆ چەند هێندەیەکی ⁦8: 496⁩. کەواتە پارچەکان ⁦496 + 496 + 488⁩ هەڵدەگرن:

FragmentپارچەData bytes Bytes of the original سەرەکیOffset fieldخانەی offsetTotal lengthدرێژیی گشتیMFئاڵای MF
14960–49505161
2496496–991625161
3488992–14791245080
A ruler of the 1,480 original data bytes with marks at 0, 496, 992 and 1480. Three fragment bars below it: bytes 0–495 (496 B) with offset 0 and MF 1; bytes 496–991 (496 B) with offset 62 and MF 1; bytes 992–1479 (488 B) with offset 124 and MF 0. Text: the offset field is the first data byte divided by 8 — 0 ÷ 8 = 0, 496 ÷ 8 = 62, 992 ÷ 8 = 124. 500-byte pieces are impossible, because 500 ÷ 8 = 62.5 is not a whole number.ڕاستەیەکی 1,480 بایتی دراوەی سەرەکی بە نیشانەی 0، 496، 992 و 1480. سێ پارچە لە خوارەوەی: بایتی 0–495 (496 B) بە offset 0 و MF 1؛ بایتی 496–991 (496 B) بە offset 62 و MF 1؛ بایتی 992–1479 (488 B) بە offset 124 و MF 0. نووسین: Fragment Offset بریتییە لە یەکەم بایتی دراوە دابەش بە 8 — 0 ÷ 8 = 0، 496 ÷ 8 = 62، 992 ÷ 8 = 124. پارچەی 500 بایتی نابێت، چونکە 500 ÷ 8 = 62.5 ژمارەیەکی تەواو نییە.
Offsets count 8-byte blocks, so the pieces must be multiples of 8.offset بلۆکی 8 دەژمێرێت، بۆیە پارچەکان دەبێت چەند هێندەیەکی 8 بن.CêIT

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 (1500−20−201500 - 20 - 20).

خاو و ناسکە: زۆرجار پارچەکان فڕێ دەدەن و ونبوونی یەک پارچە هەموو ون دەکات — ⁦RFC 8900 (2020)⁩ ئامۆژگاری نوێ دەکات کە پشتی پێ نەبەستن. بۆیە ئەمڕۆ هەوڵ دەدەن هەرگیز پێویستیان پێی نەبێت. بە دۆزینەوەی ڕێگا ⁦(RFC 1191)⁩، نێرەر DF لەسەر دادەنێت. کە نەتوانێت یەکێکیان بنێرێت، فڕێی دەدات و بە پەیامی ‘fragmentation needed’ـی وەڵام دەداتەوە، لەگەڵ بەستەری داهاتووی؛ پاشان نێرەر بچووکتر دەنێرێت. لە سەرەتاوە بچووک ڕادەگرێت: زۆرترین ⁦1,460⁩ لەسەر (1500−20−201500 - 20 - 20).

A sequence diagram with lanes PC, R1, R2 and server; the link MTUs are 1500, 1500 and 1400. PC sends 1500 bytes with DF = 1; it passes R1 but at R2 it is too big for the next link and is dropped. R2 sends ICMP ‘fragmentation needed, MTU 1400’ back to PC. PC then sends 1400 bytes with DF = 1, which reach the server. No router had to fragment anything.هێڵکارییەکی ڕیزبەندی بە ستوونەکانی PC، R1، R2 و ڕاژەکار؛ MTUـی بەستەرەکان 1500، 1500 و 1400ـن. PC 1500 بایت بە DF = 1 دەنێرێت؛ لە R1 تێدەپەڕێت، بەڵام لە R2 بۆ بەستەری داهاتوو زۆر گەورەیە و فڕێ دەدرێت. R2 پەیامی ‘fragmentation needed, MTU 1400’ـی ICMP بۆ PC دەگەڕێنێتەوە. پاشان PC 1400 بایت بە DF = 1 دەنێرێت و دەگاتە ڕاژەکارەکە. هیچ ڕێدۆزێک پێویستی بە پارچەکردن نەبوو.
The sender learns the smallest MTU on the path and fits its packets to it.نێرەر بچووکترین لەسەر ڕێگاکە دەناسێت و بەپێی ئەو دەگونجێنێت.CêIT

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 فێر دەکرێن.

Two header grids side by side. IPv4, 20 bytes or more, 13 fields: Ver, IHL, DSCP · ECN, Total Length; Identification, Flags, Fragment Offset; TTL, Protocol, Header Checksum; Source and Destination Address of 32 bits. IHL, Identification, Flags, Fragment Offset and Header Checksum are crossed out. IPv6, always 40 bytes, 8 fields: Ver, Traffic Class, Flow Label; Payload Length, Next Header, Hop Limit; Source and Destination Address of 128 bits. Legend: kept as it was; kept, often with a new name; removed; new in IPv6. Bottom: no header checksum; routers never fragment.دوو تۆڕی سەردێڕ لە تەنیشت یەک. IPv4، 20 بایت یان زیاتر، 13 خانە: Ver، IHL، DSCP · ECN، Total Length؛ Identification، Flags، Fragment Offset؛ TTL، Protocol، Header Checksum؛ Source و Destination Addressـی 32 بیت. IHL، Identification، Flags، Fragment Offset و Header Checksum خەتیان بەسەردا هاتووە. IPv6، هەمیشە 40 بایت، 8 خانە: Ver، Traffic Class، Flow Label؛ Payload Length، Next Header، Hop Limit؛ Source و Destination Addressـی 128 بیت. ڕێبەری ڕەنگەکان: وەک خۆی ماوە؛ ماوە، زۆرجار بە ناوێکی نوێ؛ لابراوە؛ نوێیە لە IPv6ـدا. لە خوارەوە: هیچ پشکنینی کۆیەکی سەردێڕ نییە؛ ڕێدۆزەکان هەرگیز پارچە ناکەن.
IPv6: fixed length, fewer fields, no router fragmentation.⁦IPv6⁩: درێژیی جێگیر، خانەی کەمتر، پارچە ناکات.CêIT

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ڕاهێنانەکان

ExerciseڕاهێنانFragment a packetپاکێتێک پارچە بکە

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: 1000−20=9801000 - 20 = 980, rounded down to a multiple of 8 = 976. The data is 2400−20=23802400 - 20 = 2380 bytes = 976 + 976 + 428.

بۆ هەر پارچەیەک: 1000−20=9801000 - 20 = 980، بۆ خوارەوە بۆ چەند هێندەیەکی 8 = ⁦976⁩. 2400−20=23802400 - 20 = 2380 = ⁦976 + 976 + 428⁩.

FragmentپارچەData bytes Offsetخانەی OffsetTotal lengthدرێژیی گشتیMFئاڵای MF
1976 (0–975)09961
2976 (976–1951)1229961
3428 (1952–2379)2444480
ExerciseڕاهێنانRead the TTLTTL بخوێنەرەوە

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 64−57=764 - 57 = 7 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⁩ـەوە دەست پێ دەکات، بۆیە 64−57=764 - 57 = 7 . تەنیا ‘نزیکەی’، چونکە ژمارەی دەستپێک تەنیا مەزەندەیە لە و ڕێگای گەڕانەوە دەکرێت جیاواز بێت لە ڕێگای چوون.

ExerciseڕاهێنانDecode the start of a headerسەرەتای سەردێڕێک شی بکەرەوە

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 = 5×256+220=15005 \times 256 + 220 = 1500: a full-size Ethernet packet.
  • 06 in the protocol field = TCP.
  • ⁦4 = IPv4⁩؛ ⁦IHL 5⁩ = سەردێڕێکی ⁦20⁩ بەبێ Options.
  • ⁦00 = DSCP 0⁩ و ⁦ECN 0⁩: هاتوچۆی ئاسایی.
  • ⁦05 dc⁩ = 5×256+220=15005 \times 256 + 220 = 1500: تەواوقەبارەی .
  • ⁦06⁩ لە خانەی = TCP.
Review questionsپرسیارەکانی پێداچوونەوە
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زاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

IPv4 Addresses in Depthناونیشانەکانی IPv4 بە وردی

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.