Chapterبەش 7 · Lectureوانە 7.3

DHCP: Automatic Addresses, DORA and LeasesDHCP: ناونیشانی خۆکار، DORA و کرێکانی DHCP

Why almost every device gets its address automatically. The lesson compares static and dynamic addressing, lists what a DHCP server hands out and where it lives, follows the four DORA messages with their addresses and UDP ports 67 and 68, and explains leases with the T1 and T2 timers, ipconfig /release and /renew, pools, exclusions and reservations, the 169.254 APIPA address when no server answers, relay agents across routers and the danger of rogue DHCP servers.

بۆچی نزیکەی هەموو ئامێرێک ناونیشانەکەی بە خۆکاری وەردەگرێت. وانەکە و بەراورد دەکات، ئەوەی دەیدات و شوێنەکەی دەناسێنێت، بە دوای چوار پەیامەکەی دەڕوات لەگەڵ ناونیشانەکانیان و ⁦UDP 67⁩ و ⁦68⁩، هەروەها بە ⁦T1⁩ و ⁦T2⁩، ⁦ipconfig /release⁩ و /renew، ، جیاکراوە و تەرخانکراو، ناونیشانی ⁦169.254⁩ـی کاتێک هیچ وەڵام نادات، بە نێوان و مەترسیی ناشەرعی ڕوون دەکاتەوە.

18 min read19 خولەک خوێندنەوە · 17 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Compare static and dynamic addressing and list the advantages of DHCP.
  • Describe the four DORA messages with their source and destination addresses and UDP ports.
  • Explain leases, T1 and T2, and use ipconfig /all, /release and /renew.
  • Explain pools, exclusions, reservations and the 169.254 APIPA address.
  • Explain why relay agents are needed and why rogue DHCP servers are dangerous.
  • و بەراورد بکەیت و سوودەکانی بژمێریت.
  • چوار پەیامەکەی لەگەڵ ناونیشانی سەرچاوە و مەبەست و UDP وەسف بکەیت.
  • ، ⁦T1⁩ و ⁦T2⁩ ڕوون بکەیتەوە و ⁦ipconfig /all⁩، /release و /renew بەکار بهێنیت.
  • ، جیاکراوە، تەرخانکراو و ناونیشانی ⁦169.254⁩ـی ڕوون بکەیتەوە.
  • ڕوون بکەیتەوە بۆچی پێویستن و بۆچی ناشەرعی مەترسیدارن.

Static or dynamic: two ways to get an addressجێگیر یان بزۆک: دوو ڕێگا بۆ وەرگرتنی ناونیشان

A computer cannot send or receive anything on a network without an IP address — and with it a subnet mask, a default gateway and DNS servers. At home, every phone and laptop on your Internet line needs these settings. A new device has none of them: no IPv4 address, no mask, no default router and no DNS server. There are two ways to set them. Static (manual): a person types the settings into each device. Dynamic: the device asks a DHCP server (Dynamic Host Configuration Protocol) and receives them automatically.

بێ ناتوانێت هیچ شتێک لە بنێرێت یان وەربگرێت — و لەگەڵیدا ، و . لە ماڵەوە، هەموو مۆبایل و کە لەسەر هێڵی پێویستی بەم ڕێکخستنانەیە. ئامێرێکی نوێ هیچیانی نییە: نە ناونیشانی ⁦IPv4⁩، نە ، نە بنەڕەتی و نە . دوو ڕێگا بۆ دانانیان هەیە. (دەستی): کەسێک ڕێکخستنەکان لە هەر ئامێرێکدا دەنووسێت. : ئامێرەکە داوا لە ⁦(Dynamic Host Configuration Protocol)⁩ دەکات و بە خۆکاری وەریاندەگرێت.

Two Windows 11 ‘Edit IP settings’ dialogs. Left, Dynamic, Automatic (DHCP): nothing to type; when the laptop joins the network a DHCP server gives it an IP address, subnet mask, default gateway and DNS servers — used by phones, laptops and guests, almost every device. Right, Static, Manual: a person types IP address 192.168.1.50, subnet mask 255.255.255.0, gateway 192.168.1.1 and preferred DNS 192.168.1.1, for each device one by one. Bottom: the path in Windows 11 Settings, Network & internet, your network, IP assignment, Edit.دوو پەنجەرەی ‘Edit IP settings’ـی Windows 11. چەپ، ناونیشانی IPـی بزۆک، Automatic (DHCP): هیچ نانووسیت؛ کاتێک لاپتۆپەکە دەچێتە ناو ڕایەڵەکە، ڕاژەکارێکی DHCP ناونیشانی IP، ماسکی ژێرڕایەڵە، دەروازەی بنەڕەتی و ڕاژەکارەکانی DNSـی پێ دەدات — مۆبایل، لاپتۆپ و میوان، نزیکەی هەموو ئامێرێک بەکاری دەهێنن. ڕاست، ناونیشانی IPـی جێگیر، Manual: کەسێک ناونیشانی IP 192.168.1.50، ماسکی ژێرڕایەڵە 255.255.255.0، دەروازەی بنەڕەتی 192.168.1.1 و DNSـی یەکەم 192.168.1.1 بۆ هەر ئامێرێک یەک بە یەک دەنووسێت. خوارەوە: ڕێگاکە لە Windows 11: Settings، Network & internet، ڕایەڵەکەت، IP assignment، Edit.
Automatic for almost everything; manual only where a person must decide.خۆکار بۆ نزیکەی هەموو شتێک؛ دەستی تەنیا ئەو شوێنەی کەسێک دەبێت بڕیار بدات.CêIT

Static addressing is hard for whoever sets it up: every address must be typed into every computer and phone, and it gets harder as the number of devices grows. So almost every device uses DHCP, a standard application-layer protocol that answers the broadcast questions of clients and gives each connected device its settings through four messages called DORA. Older Windows called the two choices Obtain an IP address automatically and Use the following IP address. A short version is in DHCP: addresses given automatically.

بۆ ئەو کەسەی دایدەنێت قورسە: دەبێت هەموو ناونیشانێک لە هەموو و مۆبایلێکدا بنووسرێت و هەتا ژمارەی ئامێرەکان زیاد بێت قورستر دەبێت. بۆیە نزیکەی هەموو ئامێرێک بەکار دەهێنێت، ستانداردی کە وەڵامی پرسیارە دەداتەوە و بە چوار پەیام کە پێیان دەڵێن ڕێکخستنەکان دەداتە هەر ئامێرێکی بەستراو. Windowsـی کۆن ئەم دوو هەڵبژاردەیەی ناو دەنا Obtain an IP address automatically و Use the following IP address. کورتەکەی لە DHCP: ناونیشان بە خۆکاریـدایە.

Why DHCP: the advantagesبۆچی DHCP: سوودەکانی

  • No duplicate addresses: the server manages its addresses and lends each one to one device at a time.
  • Fewer configuration errors: no typing slips, no address given to two computers by hand.
  • Lease times are set by the administrator — even for addresses given out to fixed devices.
  • New clients need no set-up: a guest’s phone works as soon as it joins.
  • Control by MAC address: the server can decide which MAC addresses get an address.
  • Pools: a pool can be a whole subnet, and it need not be one unbroken block.
  • Many networks, one server: pools for several subnets can live on one server.
  • ناونیشانی دووپاتە نییە: ناونیشانەکانی بەڕێوە دەبات و هەر یەکێکیان لە هەر کاتێکدا بە یەک ئامێر دەدات.
  • هەڵەی کەمتر: نە هەڵەی نووسین، نە ناونیشانێک کە بە دەست درابێتە دوو .
  • ماوەی کرێ بەڕێوەبەری دیاری دەکات — تەنانەت بۆ ئەو ناونیشانانەش کە بۆ ئامێری دیاریکراو تەرخان کراون.
  • نوێ پێویستیان بە ڕێکخستن نییە: مۆبایلی میوانێک هەر کە بەسترایەوە کار دەکات.
  • کۆنترۆڵ بە : دەتوانێت بڕیار بدات کام ناونیشان وەربگرن.
  • : پووڵێک دەتوانێت هەموو ژێرڕایەڵەیەک بێت و پێویست ناکات یەک پارچەی پچڕنەبوو بێت.
  • چەند ، یەک : پووڵی چەند ژێرڕایەڵەیەک دەتوانن لەسەر یەک بن.
A café with 40 phones. Left, by hand: one phone has 192.168.1.20 (fine), a second also has 192.168.1.20 (same address twice: conflict), a third has 192.168.1.300 (300 is not a valid number, 0–255), a fourth has gateway 192.168.1.10 (a typing slip: no Internet). Right, by DHCP: the Wi-Fi router, which is the DHCP server, gives four phones .57, .58, .59 and .60 with the right mask, gateway and DNS, and takes them back when they leave. Bottom: no typing mistakes, no duplicate addresses, no work for each new guest.چایخانەیەک بە 40 مۆبایلەوە. چەپ، بە دەست: مۆبایلێک 192.168.1.20ـی هەیە (باشە)، دووەمیش 192.168.1.20ـی هەیە (هەمان ناونیشان دوو جار: پێکدادان)، سێیەم 192.168.1.300ـی هەیە (300 ژمارەیەکی دروست نییە، 0–255)، چوارەم دەروازەی بنەڕەتی 192.168.1.10ـی هەیە (هەڵەی نووسین: ئینتەرنێت نییە). ڕاست، بە DHCP: ڕێدۆزی وای‌فای کە ڕاژەکاری DHCPـیە، .57، .58، .59 و .60 دەداتە چوار مۆبایل لەگەڵ ماسکی ژێرڕایەڵە، دەروازەی بنەڕەتی و DNSـی دروست و کاتێک دەڕۆن وەریاندەگرێتەوە. خوارەوە: نە هەڵەی نووسین، نە ناونیشانی دووپاتە، نە کار بۆ هەر میوانێکی نوێ.
Typing addresses by hand goes wrong; DHCP does not get tired.نووسینی ناونیشان بە دەست هەڵەی تێدەکەوێت؛ ماندوو نابێت.CêIT

The lease time is the time a device may use an address — the server can set it in seconds, minutes, hours or days (leases).

ماوەی کرێ ئەو کاتەیە کە ئامێرێک دەتوانێت ناونیشانێک بەکار بهێنێت — دەتوانێت بە چرکە، خولەک، کاتژمێر یان ڕۆژ دیاریی بکات (کرێکانی DHCP).

What a DHCP server hands outئەوەی ڕاژەکاری DHCP دەیدات

A DHCP server is a network server that automatically provides and assigns network settings to client devices. Its answer can include the IP address, subnet mask, default gateway, DNS servers, the domain name and the lease time. Everything after the address travels as an option with a number (RFC 2132): 1 is the mask, 3 the router, 6 the DNS servers, 15 the domain name, 51 the lease time. A server can send many more options, for example the address of a time server. How to set such options on a Cisco router is shown in More pool settings.

کە بە خۆکاری ڕێکخستنەکانی بۆ ئامێرەکانی دابین دەکات و دیاریان دەکات. وەڵامەکەی دەتوانێت ، ، ، ، و ماوەی کرێ بگرێتەوە. هەموو شتێکی دوای ناونیشانەکە وەک هەڵبژاردەیەک بە ژمارەیەکەوە دەڕوات ⁦(RFC 2132): 1⁩ ، 3 ، 6 ، ⁦15⁩ و ⁦51⁩ ماوەی کرێ. دەتوانێت زۆر هەڵبژاردەی تریش بنێرێت، بۆ نموونە ناونیشانی کات. چۆنیەتیی دانانی ئەم جۆرە هەڵبژاردانە لەسەر Cisco لە ڕێکخستنی زیاتری پووڵی ناونیشاندا پیشان دراوە.

A card of what the DHCP server gives Shilan’s laptop, whose MAC address is 02:1a:2b:3c:4d:5e and which had 0.0.0.0 and nothing set before. Rows, with DHCP option numbers: your IP address 192.168.1.57; option 1 subnet mask 255.255.255.0; option 3 default gateway (router) 192.168.1.1; option 6 DNS servers 192.168.1.1; option 15 domain name home.arpa; option 51 lease time 86400 seconds, one day; options 58 and 59 renew at T1 and rebind at T2, 12 hours and 21 hours; option 54 DHCP server 192.168.1.1.کارتی ئەوەی ڕاژەکاری DHCP دەیداتە لاپتۆپی شیلان، کە ناونیشانی MACـەکەی 02:1a:2b:3c:4d:5eـیە و پێشتر 0.0.0.0 بوو و هیچی ڕێک نەخرابوو. ڕیزەکان، لەگەڵ ژمارەی هەڵبژاردەکانی DHCP: ناونیشانی IPـەکەت 192.168.1.57؛ هەڵبژاردەی 1 ماسکی ژێرڕایەڵە 255.255.255.0؛ هەڵبژاردەی 3 دەروازەی بنەڕەتی (ڕێدۆز) 192.168.1.1؛ هەڵبژاردەی 6 ڕاژەکارەکانی DNS 192.168.1.1؛ هەڵبژاردەی 15 ناوی دۆمەین home.arpa؛ هەڵبژاردەی 51 ماوەی کرێ 86400 چرکە، ڕۆژێک؛ هەڵبژاردەکانی 58 و 59 کاتی نوێکردنەوە T1 و T2، 12 کاتژمێر و 21 کاتژمێر؛ هەڵبژاردەی 54 ڕاژەکاری DHCP 192.168.1.1.
One answer configures the whole laptop.یەک وەڵام هەموو ڕێک دەخات.CêIT

Where the DHCP server livesڕاژەکاری DHCP لە کوێیە

The DHCP server can be one of three things. A router: at home and in a café the Wi-Fi router does the job — a router as DHCP server is useful in small networks where no dedicated server is available. A server on the LAN: companies and universities run DHCP on Windows Server or Linux, often for many LANs at once. A server at the ISP: it gives your home router its outside address. Whoever runs it, the protocol and the messages are the same.

دەتوانێت یەکێک لەم سێ شتە بێت. : لە ماڵەوە و لە چایخانە ئەم کارە دەکات — وەک بۆ بچووک بەسوودە کە تایبەتی تێدا نییە. لە : کۆمپانیا و زانکۆکان لەسەر Windows Server یان Linux کار پێ دەکەن، زۆرجار بۆ چەند پێکەوە. لە : ناونیشانی دەرەوە دەداتە ماڵەوەت. هەر کەسێک بەڕێوەی ببات، و پەیامەکان هەمان شتن.

Three panels. At home or in a café: the Wi-Fi router is the DHCP server and gives addresses to two phones and a laptop. In a company or university: a server on the LAN, connected to a switch, serves several PCs, often for many LANs. At the ISP: the ISP’s DHCP server gives your home router its outside address, here WAN 100.64.12.34. Bottom: whoever runs it, the DHCP protocol is the same — the same four messages, the same ports.سێ بەش. لە ماڵەوە یان لە چایخانە: ڕێدۆزی وای‌فای ڕاژەکاری DHCPـیە و ناونیشان دەداتە دوو مۆبایل و لاپتۆپێک. لە کۆمپانیا یان زانکۆ: ڕاژەکارێک لە ڕایەڵەی ناوچەییدا کە بە سویچێکەوە بەستراوە خزمەتی چەند کۆمپیوتەرێک دەکات، زۆرجار بۆ چەند ڕایەڵەی ناوچەییەک. لە دابینکەری ئینتەرنێت: ڕاژەکاری DHCPـی دابینکەری ئینتەرنێت ناونیشانی دەرەوە دەداتە ڕێدۆزی ماڵەوەت، لێرەدا WAN 100.64.12.34. خوارەوە: هەر کەسێک بەڕێوەی ببات، پرۆتۆکۆڵی DHCP هەمان شتە — هەمان چوار پەیام، هەمان پۆرتەکان.
Router, company server or ISP — the same protocol.، کۆمپانیا یان — هەمان .CêIT

DORA: four messagesDORA: چوار پەیام

Every time a client needs a new lease, it and the server exchange four messages: Discover, Offer, Request, Acknowledge — DORA. In plain words: “Have you got an IP for me?” — “Yes, I have this one.” — “OK, give me that one.” — “Done, here you are.” This is how the server hands out addresses and settings dynamically, so that every device has a unique address and the right configuration.

هەر جارێک پێویستی بە کرێیەکی نوێ بێت، خۆی و چوار پەیام ئاڵوگۆڕ دەکەن: Discover، Offer، Request، Acknowledge — . بە وشەی سادە: «هیچ ئایپییەکت هەیە؟» — «بەڵێ، ئەمەم هەیە.» — «دەی باشە ئەوەم بەرێ.» — «تەواوە، فەرموو.» بەم شێوەیە ناونیشان و ڕێکخستن بە شێوەی بزۆک دابەش دەکات، بۆ ئەوەی هەموو ئامێرێک ناونیشانێکی بێوێنە و دروستی هەبێت.

An animation in six frames. Shilan’s laptop, IP 0.0.0.0, MAC 02:1a:2b:3c:4d:5e, joins the café Wi-Fi; the café router, 192.168.1.1, is the DHCP server; a phone with 192.168.1.23 is also on the network. D, Discover: a broadcast from 0.0.0.0 port 68 to 255.255.255.255 port 67 — is there a DHCP server, have you got an IP for me? The phone hears it and ignores it. O, Offer: from 192.168.1.1 port 67 to 192.168.1.57 port 68 — I can give you 192.168.1.57 with mask, gateway and DNS. R, Request: again a broadcast from 0.0.0.0:68 to 255.255.255.255:67 — I take 192.168.1.57 from server 192.168.1.1. A, Acknowledge: from 192.168.1.1:67 to 192.168.1.57:68 — done, it is yours for one day. Last frame: the laptop is configured with 192.168.1.57, mask 255.255.255.0, gateway and DNS 192.168.1.1, lease one day.
An animation in six frames. Shilan’s laptop, IP 0.0.0.0, MAC 02:1a:2b:3c:4d:5e, joins the café Wi-Fi; the café router, 192.168.1.1, is the DHCP server; a phone with 192.168.1.23 is also on the network. D, Discover: a broadcast from 0.0.0.0 port 68 to 255.255.255.255 port 67 — is there a DHCP server, have you got an IP for me? The phone hears it and ignores it. O, Offer: from 192.168.1.1 port 67 to 192.168.1.57 port 68 — I can give you 192.168.1.57 with mask, gateway and DNS. R, Request: again a broadcast from 0.0.0.0:68 to 255.255.255.255:67 — I take 192.168.1.57 from server 192.168.1.1. A, Acknowledge: from 192.168.1.1:67 to 192.168.1.57:68 — done, it is yours for one day. Last frame: the laptop is configured with 192.168.1.57, mask 255.255.255.0, gateway and DNS 192.168.1.1, lease one day.
Discover and Request go to everyone; Offer and Ack come back from the server.Discover و Request بۆ هەمووان دەچن؛ Offer و Ack لە دەگەڕێنەوە.CêIT
  1. DiscoverDiscover (دۆزینەوە)

    The device that needs an address broadcasts a DHCP Discover to find a DHCP server. It does not know the server’s address, so the destination is 255.255.255.255; it has no address yet, so the source is 0.0.0.0.

    ئەو ئامێرەی پێویستی بە ناونیشانە پەیامی DHCP Discover دەکات بۆ دۆزینەوەی DHCP. ناونیشانی نازانێت، بۆیە مەبەست ⁦255.255.255.255⁩ـە؛ هێشتا ناونیشانی نییە، بۆیە سەرچاوە ⁦0.0.0.0⁩ـە.

  2. OfferOffer (پێشکەش)

    A server answers with one free address for the device, and the mask, default gateway, DNS servers and lease time.

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

  3. RequestRequest (داواکردن)

    The device asks for the offered address — still as a broadcast, naming the server it chose.

    ئامێرەکە داوای ناونیشانە پێشکەشکراوەکە دەکات — هێشتا بە ، بە ناوهێنانی ئەو هەڵیبژاردووە.

  4. AcknowledgeAcknowledge (قبوڵکردن)

    The server confirms and records the lease. Now the device may use the address.

    پشتڕاستی دەکاتەوە و کرێکە تۆمار دەکات. ئێستا ئامێرەکە دەتوانێت ناونیشانەکە بەکار بهێنێت.

DORA: four messagesDORA: چوار پەیام

Addresses and ports of each messageناونیشان و پۆرتەکانی هەر پەیامێک

DORA on the café network (server 192.168.1.1, new address 192.168.1.57) لە چایخانەکە ( ⁦192.168.1.1⁩، ناونیشانی نوێ ⁦192.168.1.57⁩)
MessageپەیامIP from → toIP لە ← بۆUDP ports UDPSent asچۆن دەنێردرێت
D Discover0.0.0.0 → 255.255.255.25568 → 67broadcast
O Offer192.168.1.1 → 192.168.1.5767 → 68to the offered address, or broadcast if the client asksبۆ ناونیشانە پێشکەشکراوەکە، یان ئەگەر داوای بکات
R Request0.0.0.0 → 255.255.255.25568 → 67broadcast
A Ack192.168.1.1 → 192.168.1.5767 → 68like the Offerوەک Offer

0.0.0.0 is the source address of a device that has no address yet. 255.255.255.255 is the limited broadcast: every device on the local network receives it, and routers never forward it to other networks (see broadcast messages). The Request is a broadcast so that any other server that made an offer learns it was not chosen and keeps that address free. Before using the address, a careful client checks with ARP that nobody else has it; if someone does, it sends a DHCPDECLINE and starts again. DHCP runs on UDP because only UDP can send to everyone on the LAN (Finding each other on a LAN).

⁦0.0.0.0⁩ ناونیشانی سەرچاوەی ئامێرێکە کە هێشتا ناونیشانی نییە. ⁦255.255.255.255⁩ سنووردارە: هەموو ئامێرێکی ناوخۆیی وەریدەگرێت و هەرگیز بۆ تری نانێرن (بڕوانە پەیامەکانی پەخشکردن). Request بۆ ئەوەی هەر تر کە Offerـی کردبێت بزانێت هەڵنەبژێردراوە و ئەو ناونیشانە بەتاڵ بهێڵێتەوە. پێش بەکارهێنانی ناونیشانەکە، وریا بە دەپشکنێت کە کەسی تر هەیەتی یان نا؛ ئەگەر هەبوو، DHCPDECLINE دەنێرێت و لە سەرەتاوە دەست پێ دەکاتەوە. لەسەر کار دەکات، چونکە تەنیا دەتوانێت بۆ هەموو ئامێرەکانی بنێرێت (دۆزینەوەی یەکتر لە ڕایەڵەی ناوچەییدا).

An application-layer protocol on UDP 67 and 68پرۆتۆکۆڵێکی چینی ئەپ لەسەر ⁦UDP 67⁩ و ⁦68⁩

DHCP works in the application layer, like DNS: its messages are made by the DHCP client and the DHCP server programs, and it gives hosts a dynamic way of leasing addresses. Underneath, it travels in UDP: the server listens on port 67 and the client on port 68. It could not use TCP — a TCP connection needs addresses on both sides, and the client has none yet; and only a UDP datagram can be sent to everyone as a broadcast.

لە کار دەکات، وەک : پەیامەکانی و دروستیان دەکەن و ڕێگایەکی بزۆک بە دەدات بۆ بەکرێگرتنی ناونیشان. لە خوارەوە بە UDP دەڕوات: گوێ لە ⁦67⁩ دەگرێت و لە ⁦68⁩. نەیدەتوانی TCP بەکار بهێنێت — پەیوەندیی TCP پێویستی بە ناونیشان لە هەردوو لا هەیە و هێشتا هیچی نییە؛ هەروەها تەنیا UDP دەتوانێت وەک بۆ هەمووان بنێردرێت.

Four nested layers of a DHCP Discover. Ethernet frame: to ff:ff:ff:ff:ff:ff, everyone; from 02:1a:2b:3c:4d:5e. IP packet: to 255.255.255.255, everyone; from 0.0.0.0, no address yet. UDP datagram: to port 67, the DHCP server; from port 68, the DHCP client. DHCP message: type DHCPDISCOVER (option 53) and the client hardware address 02:1a:2b:3c:4d:5e. Note: no address yet, so the source is 0.0.0.0; no idea where the server is, so the destination is everyone; and no TCP connection is possible without an address, so DHCP uses UDP.چوار چینی ناو یەکی پەیامێکی DHCP Discover. فرەیمی Ethernet: بۆ ff:ff:ff:ff:ff:ff، هەمووان؛ لە 02:1a:2b:3c:4d:5e. پاکێتی IP: بۆ 255.255.255.255، هەمووان؛ لە 0.0.0.0، هێشتا ناونیشان نییە. داتاگرامی UDP: بۆ پۆرت 67، ڕاژەکاری DHCP؛ لە پۆرت 68، ڕاژەخوازی DHCP. پەیامی DHCP: جۆری DHCPDISCOVER (هەڵبژاردەی 53) و ناونیشانی ئامێری ڕاژەخواز 02:1a:2b:3c:4d:5e. تێبینی: هێشتا ناونیشان نییە، بۆیە سەرچاوە 0.0.0.0ـە؛ نازانێت ڕاژەکارەکە لە کوێیە، بۆیە مەبەست هەمووانە؛ بێ ناونیشانیش پەیوەندیی TCP ناکرێت، بۆیە DHCP UDP بەکار دەهێنێت.
Layer by layer: everyone at layers 2 and 3, the DHCP ports at layer 4.چین بە چین: هەمووان لە چینەکانی 2 و 3، DHCP لە چینی 4.CêIT

IPv6 hosts get their addresses with SLAAC or DHCPv6 (UDP ports 546 and 547) — see DHCPv6: stateful and stateless. Port numbers in general are in ports and sockets.

⁦IPv6⁩ ناونیشانەکانیان بە یان ⁦DHCPv6⁩ وەردەگرن ( ⁦UDP 546⁩ و ⁦547⁩) — بڕوانە ⁦DHCPv6⁩: دۆخدار و بێ‌دۆخ. ژمارەی بە گشتی لە پۆرتەکان و سۆکێتەکانـدایە.

Leases: addresses on loanکرێکانی DHCP: ناونیشانی بە قەرز

A DHCP lease is the time for which a server lends an address and its settings to a client; the administrator sets its length on the server. During the lease the client may use them. The client does not wait for the end. At T1, by default 50 % of the lease, it asks the same server to renew, with a Request sent straight to it; the server answers with an Ack and the lease starts again. If that server does not answer, at T2 — by default 87.5 % — the client asks any server by broadcast (rebinding). If the lease runs out with no answer, the client must stop using the address and start DORA again.

ئەو کاتەیە کە ناونیشانێک و ڕێکخستنەکانی بە قەرز دەداتە ؛ بەڕێوەبەری درێژییەکەی لەسەر دیاری دەکات. لە ماوەی کرێکەدا دەتوانێت بەکاریان بهێنێت. چاوەڕێی کۆتایی ناکات. لە ⁦T1⁩، کە بە شێوەی بنەڕەت ⁦50%⁩ـی کرێکەیە، داوا لە هەمان دەکات نوێی بکاتەوە، بە Requestـێک کە ڕاستەوخۆ بۆی دەنێرێت؛ بە Ack وەڵام دەداتەوە و کرێکە لە سەرەتاوە دەست پێ دەکاتەوە. ئەگەر ئەو وەڵام نەداتەوە، لە ⁦T2⁩ — بە شێوەی بنەڕەت ⁦87.5%⁩ — بە لە هەر دەپرسێت (دووپاتە بەستنەوە). ئەگەر کرێکە بێ وەڵام تەواو بێت، دەبێت واز لە ناونیشانەکە بهێنێت و دیسان دەست پێ بکاتەوە.

A timeline of an 8-hour lease. From 0 to 4 hours, bound: use the address. At 4 hours, T1 = 50 %: ask the same server by unicast; an ACK starts the timers again. From 4 to 7 hours, renewing. At 7 hours, T2 = 87.5 %: ask any server by broadcast. From 7 to 8 hours, rebinding. At 8 hours the lease ends: stop using the address. Notes: a device that stays online renews at 4 hours and keeps the same address for months; ipconfig /release gives the address back at any time, and a device that just leaves lets the lease run out.هێڵێکی کاتی بۆ کرێیەکی 8 کاتژمێری. لە 0 تا 4 کاتژمێر، بەستراو: ناونیشانەکە بەکار بهێنە. لە کاتژمێری 4دا، T1 = 50%: بە تاکپەخش لە هەمان ڕاژەکار بپرسە؛ ACK تایمەرەکان دیسان دەست پێ دەکاتەوە. لە 4 تا 7 کاتژمێر، نوێکردنەوە. لە کاتژمێری 7دا، T2 = 87.5%: بە پەخشکردن لە هەر ڕاژەکارێک بپرسە. لە 7 تا 8 کاتژمێر، دووپاتە بەستنەوە. لە کاتژمێری 8دا کرێکە کۆتایی دێت: ناونیشانەکە بەکار مەهێنە. تێبینی: ئامێرێک کە ئۆنلاین دەمێنێتەوە لە کاتژمێری 4دا نوێی دەکاتەوە و بۆ چەند مانگێک هەمان ناونیشان دەهێڵێتەوە؛ ipconfig /release لە هەر کاتێکدا ناونیشانەکە دەگەڕێنێتەوە و ئامێرێک کە تەنیا دەڕوات کرێکە بە خۆی تەواو دەبێت.
T1 at half the lease, T2 at seven eighths, then the end.⁦T1⁩ لە نیوەی کرێدا، ⁦T2⁩ لە حەوت هەشتیەکدا، پاشان کۆتایی.CêIT

See and control your lease: ipconfigبینین و کۆنترۆڵکردنی کرێکەت: ipconfig

On Windows you can see the lease and act on it. ipconfig /all shows whether DHCP is enabled, which server gave the address and when the lease was obtained and when it expires. ipconfig /release sends a DHCPRELEASE to the server and gives the address back; ipconfig /renew asks for a lease again. Do not use /release over a remote connection: it cuts you off. The rest of ipconfig is in Windows network commands. The 3D network lab has no DHCP server — its devices use fixed addresses — so DHCP is practised in Packet Tracer (a DHCP server in Packet Tracer).

لە Windowsـدا دەتوانیت کرێکە ببینیت و کاری لەسەر بکەیت. ipconfig /all پیشان دەدات چالاکە یان نا، کام ناونیشانەکەی داوە و کرێکە کەی وەرگیراوە و کەی تەواو دەبێت. ipconfig /release پەیامی DHCPRELEASE بۆ دەنێرێت و ناونیشانەکە دەگەڕێنێتەوە؛ ipconfig /renew دیسان داوای کرێ دەکاتەوە. /release لە پەیوەندییەکی دوورەوە بەکار مەهێنە: پەیوەندییەکەت دەپچڕێنێت. بەشەکانی تری ipconfig لە فەرمانەکانی ڕایەڵەی Windowsـدان. تاقیگەی سێ ڕەهەندیی ڕایەڵە تێدا نییە — ئامێرەکانی ناونیشانی جێگیر بەکار دەهێنن — بۆیە لە Packet Tracer ڕاهێنانی لەسەر دەکرێت (ڕاژەکاری DHCP لە Packet Tracer).

Lease commands in Command Promptفەرمانەکانی کرێ لە Command PromptBATType in a terminalلە تێرمیناڵدا بینووسە
ipconfig /all
ipconfig /release
ipconfig /renew

Pools, exclusions and reservationsپووڵی ناونیشان، جیاکراوە و تەرخانکراو

On the server, the range of addresses it may lend on one subnet is a pool (Windows Server calls it a scope). Addresses that must not be lent — the router and the servers set by hand — are excluded. A reservation ties one address to one MAC address, so a printer or a camera always gets the same address while still using DHCP. One server can hold pools for several subnets, and a pool need not be one unbroken block. The administrator can also limit which MAC addresses are served.

لەسەر ، ئەو ناونیشانانەی دەتوانێت لە یەک ژێرڕایەڵەدا بە قەرزیان بدات ـە (Windows Server پێی دەڵێت scope). ئەو ناونیشانانەی نابێت بدرێن — و ئەو بە دەست ڕێکخراون — جیا دەکرێنەوە. تەرخانکردن یەک ناونیشان بە یەک دەبەستێتەوە، بۆیە یان کامێرایەک هەمیشە هەمان ناونیشان وەردەگرێت و هێشتا بەکار دەهێنێت. یەک دەتوانێت پووڵی چەند ژێرڕایەڵەیەک هەڵبگرێت و پێویست ناکات پووڵێک یەک پارچەی پچڕنەبوو بێت. بەڕێوەبەریش دەتوانێت دیاری بکات کام خزمەت دەکرێن.

One scope for 192.168.1.0/24, not to scale: .0 network address, .1 router, .2 to .19 excluded for static servers, .20 to .200 the pool given to clients (181 addresses), .201 to .254 spare, .255 broadcast address. Below: current leases — 192.168.1.57 Shilan’s laptop until 18:00, .58 Karwan’s phone until 17:30, .59 a smart TV until 21:10. A reservation: a printer with MAC 02:00:5e:aa:bb:cc always gets 192.168.1.20 — same MAC, same address, every time.یەک scope بۆ 192.168.1.0/24، بە پێوانەی ڕاست نا: .0 ناسەڕایەڵە، .1 ڕێدۆز، .2 تا .19 جیاکراوە بۆ ڕاژەکارەکانی جێگیر، .20 تا .200 ئەو پووڵەی بە ڕاژەخوازەکان دەدرێت (181 ناونیشان)، .201 تا .254 یەدەگ، .255 ناسەپەخش. خوارەوە: کرێکانی ئێستا — 192.168.1.57 لاپتۆپی شیلان تا 18:00، .58 مۆبایلی کاروان تا 17:30، .59 تەلەفزیۆنێکی زیرەک تا 21:10. تەرخانکردنێک: چاپەرێک بە MAC 02:00:5e:aa:bb:cc هەمیشە 192.168.1.20 وەردەگرێت — هەمان MAC، هەمان ناونیشان، هەموو جارێک.
The pool is lent out; exclusions are kept back; reservations are promised to one MAC.پووڵەکە بە قەرز دەدرێت؛ جیاکراوەکان دەهێڵرێنەوە؛ تەرخانکراوەکان بە یەک MAC بەڵێن دراون.CêIT

No answer: APIPA and 169.254وەڵام نییە: APIPA و ⁦169.254⁩

If no DHCP server answers — the cable is out, the Wi-Fi password was wrong, the server is down — a computer does not stay without an address. It gives itself a link-local address from 169.254.0.0/16; Microsoft calls this APIPA (Automatic Private IP Addressing) and the standard is RFC 3927. It picks a random address between 169.254.1.0 and 169.254.254.255, checks with three ARP probes that no neighbour uses it, and keeps asking DHCP in the background. Such an address reaches only devices on the same link: there is no gateway, and routers never forward these packets.

ئەگەر هیچ وەڵام نەداتەوە — کێبڵەکە دەرهاتووە، هەڵە بوو، کوژاوەتەوە — بێ ناونیشان نامێنێتەوە. لە ⁦169.254.0.0/16⁩ بە خۆی دەدات؛ Microsoft پێی دەڵێت ⁦(Automatic Private IP Addressing)⁩ و ستانداردەکەی ⁦RFC 3927⁩ـە. ناونیشانێکی هەڕەمەکی لە نێوان ⁦169.254.1.0⁩ و ⁦169.254.254.255⁩ هەڵدەبژێرێت، بە سێ پشکنینی دڵنیا دەبێتەوە کە هیچ دراوسێیەک بەکاری ناهێنێت و لە پشتەوە هەر داوای دەکات. ناونیشانێکی وا تەنیا دەگاتە ئامێرەکانی هەمان بەستەر: نییە و هەرگیز ئەم نانێرن.

A flowchart. Send a DHCP Discover. An offer within a few tries? Yes: DORA gives a normal address, for example 192.168.1.57. No: pick a random 169.254.x.y between 169.254.1.0 and 169.254.254.255, then ask with three ARP probes whether it is in use; if yes, try another; if no, use it — talk only to neighbours on the same link. No gateway and no Internet; routers never forward 169.254.x.y. In the background it keeps asking DHCP and switches as soon as a server answers. A box shows how it looks in ipconfig: Autoconfiguration IPv4 Address 169.254.37.112.نەخشەیەکی هەنگاوەکان. DHCP Discover بنێرە. لە چەند هەوڵێکدا Offer هات؟ بەڵێ: DORA ناونیشانێکی ئاسایی دەدات، بۆ نموونە 192.168.1.57. نا: ناونیشانێکی هەڕەمەکیی 169.254.x.y لە نێوان 169.254.1.0 و 169.254.254.255 هەڵبژێرە، پاشان بە سێ پشکنینی ARP بپرسە کەس بەکاری دەهێنێت یان نا؛ ئەگەر بەڵێ، یەکێکی تر تاقی بکەرەوە؛ ئەگەر نا، بەکاری بهێنە — تەنیا قسە لەگەڵ دراوسێکانی هەمان بەستەر. دەروازەی بنەڕەتی و ئینتەرنێت نییە؛ ڕێدۆزەکان هەرگیز 169.254.x.y نانێرن. لە پشتەوە هەر داوای DHCP دەکات و هەر کە ڕاژەکارێک وەڵامی دایەوە دەیگۆڕێت. سندووقێک نیشان دەدات لە ipconfigـدا چۆن دەردەکەوێت: Autoconfiguration IPv4 Address 169.254.37.112.
169.254 in ipconfig means: DHCP was not reached.⁦169.254⁩ لە ipconfigـدا واتە: نەگەیشتە.CêIT

So when ipconfig shows Autoconfiguration IPv4 Address . . : 169.254.37.112, read it as “DHCP failed”: check the cable or Wi-Fi, then the router or server. The address itself was introduced in loopback and APIPA. For practice, follow a real case in an address in 169.254.x.x, and see a Packet Tracer pool that handed out wrong addresses in What went wrong here?

کەواتە کاتێک ipconfig پیشان دەدات Autoconfiguration IPv4 Address . . : 169.254.37.112، وای بخوێنەوە « سەرکەوتوو نەبوو»: سەرەتا کێبڵ یان ، پاشان یان بپشکنە. خودی ناونیشانەکە لە loopback و APIPAـدا ناسێنرا. بۆ ڕاهێنان، دۆخێکی ڕاستەقینە لە ناونیشانێک لە ⁦169.254.x.x⁩ـدا ببینە و پووڵێکی Packet Tracer کە ناونیشانی هەڵەی دابەش کرد لە لێرەدا چی هەڵە بوو؟

A server on another network: relay agentsڕاژەکارێک لە ڕایەڵەیەکی تر: گوازەرەوەکانی DHCP

The Discover is a broadcast, and routers do not forward broadcasts — so how can one DHCP server in a university serve every LAN? A router (or layer-3 switch) on the client’s LAN acts as a DHCP relay agent: it receives the broadcast, sends it on as a unicast to the server’s address and writes the address of its own interface into the message (the giaddr field). The server uses that address to choose the right pool, and its reply goes back through the relay to the client. On Cisco routers this is the ip helper-address command, configured in DHCP on a Cisco router.

Discover و نانێرن — کەواتە چۆن یەک لە زانکۆیەکدا دەتوانێت خزمەتی هەموو بکات؟ (یان چینی ⁦3⁩) لە وەک کار دەکات: وەردەگرێت، وەک بۆ ناونیشانی دەینێرێت و ناونیشانی خۆی دەنووسێتە ناو پەیامەکە (خانەی giaddr). بەو ناونیشانە پووڵە دروستەکە هەڵدەبژێرێت و وەڵامەکەی لە ڕێگەی گوازەرەوەکەوە دەگەڕێتەوە بۆ . لەسەر Cisco ئەمە فەرمانی ip helper-addressـە کە لە DHCP لەسەر ڕێدۆزی Ciscoـدا ڕێک دەخرێت.

Two LANs joined by router R1. LAN 1, 192.168.10.0/24, has a new laptop; LAN 2, 192.168.20.0/24, has the DHCP server 192.168.20.5 with pools for .10 and .20. R1’s interfaces are G0/0 192.168.10.1 and G0/1 192.168.20.1; R1 is the relay agent. 1: the laptop’s Discover to 255.255.255.255 stops at the router. 2: R1 sends it as a unicast to 192.168.20.5 with giaddr = 192.168.10.1. 3: the server picks the .10 pool from giaddr. 4: the offer comes back through R1 to the laptop. Notes: a router never forwards a broadcast; the relay turns it into a unicast and adds its own address; on Cisco, ip helper-address 192.168.20.5 on G0/0.دوو ڕایەڵەی ناوچەیی کە ڕێدۆزی R1 بەیەکیان دەبەستێت. ڕایەڵەی ناوچەیی 1، 192.168.10.0/24، لاپتۆپێکی نوێی تێدایە؛ ڕایەڵەی ناوچەیی 2، 192.168.20.0/24، ڕاژەکاری DHCP 192.168.20.5ـی تێدایە بە پووڵ بۆ .10 و .20. نێوبەستەکانی R1 بریتین لە G0/0 192.168.10.1 و G0/1 192.168.20.1؛ R1 گوازەرەوەی DHCPـە. 1: Discoverـی لاپتۆپەکە بۆ 255.255.255.255 لە ڕێدۆزەکە دەوەستێت. 2: R1 وەک تاکپەخش بە giaddr = 192.168.10.1 بۆ 192.168.20.5ی دەنێرێت. 3: ڕاژەکارەکە لە giaddrـەوە پووڵی .10 هەڵدەبژێرێت. 4: Offer بە R1دا دەگەڕێتەوە بۆ لاپتۆپەکە. تێبینی: ڕێدۆز هەرگیز پەخشکردن نانێرێت؛ گوازەرەوەکە دەیکات بە تاکپەخش و ناونیشانی خۆی زیاد دەکات؛ لە Cisco، ip helper-address 192.168.20.5 لەسەر G0/0.
The relay agent carries the broadcast across the router as a unicast. وەک بە تێدەپەڕێنێت.CêIT

Rogue DHCP serversڕاژەکارەکانی DHCPـی ناشەرعی

A client believes the first Offer it accepts. A rogue DHCP server — a home router plugged into an office wall socket by mistake, or an attacker’s laptop — can answer before the real one and hand out a wrong gateway or DNS server. Then nothing works, or worse, the victim’s traffic passes through the attacker: a man-in-the-middle attack. Switches defend against this with DHCP snooping: only the port towards the real server is trusted, and server messages (Offer, Ack) that arrive on other ports are dropped. It is configured with switch port security.

باوەڕ بە یەکەم Offer دەکات کە وەریدەگرێت. ناشەرعی — ماڵەوە کە بە هەڵە لە پریزێکی دیواری ئۆفیسدا دانراوە، یان — دەتوانێت پێش ڕاستەقینەکە وەڵام بداتەوە و یان هەڵە بدات. ئەوکات هیچ شتێک کار ناکات، یان خراپتر، هاتوچۆی قوربانییەکە بە تێدەپەڕێت: هێرشی کەسی ناوەڕاست. بە بەرگری لەمە دەکەن: تەنیا ئەو بەرەو ڕاستەقینەکەیە متمانەپێکراوە و پەیامەکانی (Offer، Ack) کە لە ترەوە دێن فڕێ دەدرێن. لەگەڵ ئاسایشی دەرچەکانی سویچـدا ڕێک دەخرێت.

A café switch. On its trusted port, the real router 192.168.1.1; on an untrusted port, an attacker’s laptop. Lana’s phone is also connected. The attacker answers first with an Offer whose gateway and DNS are 192.168.1.66 — the attacker itself — so her traffic now passes through the attacker. Bottom: the defence is DHCP snooping on the switch, which drops server messages (Offer, Ack) arriving on untrusted ports; taught with switch security in Routing and Switching.سویچی چایخانەیەک. لەسەر پۆرتە متمانەپێکراوەکەی، ڕێدۆزی ڕاستەقینە 192.168.1.1؛ لەسەر پۆرتێکی نامتمانە، لاپتۆپی هێرشبەرێک. مۆبایلی لاناش بەستراوە. هێرشبەرەکە یەکەم جار بە Offerـێک وەڵام دەداتەوە کە دەروازەی بنەڕەتی و DNSـەکەی 192.168.1.66ـە — خودی هێرشبەرەکە — بۆیە ئێستا هاتوچۆی لانا بە هێرشبەرەکەدا تێدەپەڕێت. خوارەوە: بەرگری DHCP snoopingـە لەسەر سویچەکە، کە پەیامەکانی ڕاژەکار (Offer، Ack) کە لە پۆرتەکانی نامتمانەوە دێن فڕێ دەدات؛ لەگەڵ ئاسایشی سویچ لە کۆرسی Routing and Switching دەخوێندرێت.
The first Offer wins — so only trusted ports may send Offers.یەکەم Offer دەباتەوە — بۆیە تەنیا متمانەپێکراو دەتوانن Offer بنێرن.CêIT

Exam practiceڕاهێنانی تاقیکردنەوە

ExerciseڕاهێنانMidterm questionپرسیاری نیوەی وەرز

A midterm asked: “Explain DHCP.” Write a full-marks answer.

تاقیکردنەوەیەکی نیوەی وەرز پرسی: « ڕوون بکەرەوە.» وەڵامێکی نمرە تەواو بنووسە.

Show answerوەڵامەکە پیشان بدە

Model answer. DHCP (Dynamic Host Configuration Protocol) is a standard application-layer protocol that answers the broadcast queries of clients. A DHCP server is a network server that automatically assigns network settings to clients — an IP address, subnet mask, default gateway and DNS servers — for a limited time, the lease. DHCP runs over UDP (server port 67, client port 68) and takes four steps, DORA:

وەڵامی نموونە. ⁦(Dynamic Host Configuration Protocol)⁩ ستانداردی کە وەڵامی پرسیارە دەداتەوە. کە بە خۆکاری ڕێکخستنەکانی دەداتە — ، ، و — بۆ ماوەیەکی سنووردار، واتە . لەسەر UDP کار دەکات ( ⁦67⁩، ⁦68⁩) و چوار هەنگاوی هەیە، :

  1. Discover — the client broadcasts (from 0.0.0.0 to 255.255.255.255) to find a DHCP server.
  2. Offer — a server offers one free IP address with the other settings.
  3. Request — the client asks for that address, again by broadcast.
  4. Acknowledge — the server confirms; the client may now use the address until the lease ends, renewing at half the lease.
  1. Discover — دەکات (لە ⁦0.0.0.0⁩ـەوە بۆ ⁦255.255.255.255⁩) بۆ دۆزینەوەی .
  2. Offer — یەک بەتاڵ لەگەڵ ڕێکخستنەکانی تر پێشکەش دەکات.
  3. Request — داوای ئەو ناونیشانە دەکات، دیسان بە .
  4. Acknowledge — پشتڕاستی دەکاتەوە؛ ئێستا دەتوانێت ناونیشانەکە تا کۆتایی کرێکە بەکار بهێنێت و لە نیوەی کرێکەدا نوێی دەکاتەوە.

Note that the Offer carries one address (several servers may each make an offer), not a list to choose from.

ئاگاداربە کە Offer یەک ناونیشان هەڵدەگرێت (چەند دەتوانن هەریەکە Offerـێک بکەن)، نەک لیستێک بۆ هەڵبژاردن.

ExerciseڕاهێنانLab sheet: DORA with addresses and portsپەڕەی تاقیگە: DORA بە ناونیشان و پۆرتەکانەوە

A Packet Tracer lab uses a DHCP server at 7.7.7.7 that offers 7.7.7.51. For each DORA message, write the source and destination IP address and UDP port.

تاقیگەیەکی Packet Tracer بە ⁦7.7.7.7⁩ بەکار دەهێنێت کە ⁦7.7.7.51⁩ پێشکەش دەکات. بۆ هەر پەیامێکی ، و UDPـی سەرچاوە و مەبەست بنووسە.

Show answerوەڵامەکە پیشان بدە
MessageپەیامSourceسەرچاوەDestinationمەبەست
Discover0.0.0.0 : 68255.255.255.255 : 67
Offer7.7.7.7 : 677.7.7.51 : 68
Request0.0.0.0 : 68255.255.255.255 : 67
Ack7.7.7.7 : 677.7.7.51 : 68

The client always speaks from port 68 to port 67, the server from 67 to 68. Note: 7.7.7.x is a public block that the lab only borrows inside Packet Tracer; a real network would use private addresses such as 192.168.1.x.

هەمیشە لە ⁦68⁩ـەوە بۆ ⁦67⁩ قسە دەکات و لە ⁦67⁩ـەوە بۆ ⁦68⁩. تێبینی: بلۆکی ⁦7.7.7.x⁩ ناونیشانی گشتییە و تاقیگەکە تەنیا لە ناو Packet Tracerـدا بەکاری دەهێنێت؛ ڕاستەقینە وەک ⁦192.168.1.x⁩ بەکار دەهێنێت.

Common mistakesهەڵە باوەکان

  • “DHCP runs over TCP.” It runs over UDP: server port 67, client port 68. A client without an address cannot open a TCP connection.
  • “Port 67 is the client.” 67 is the server, 68 the client.
  • “The Request goes only to the chosen server.” In DORA it is a broadcast, so the other servers learn they were not chosen. (Later renewals at T1 are sent straight to the server.)
  • “The Offer is a list of addresses to choose from.” Each Offer carries one address; several servers may each send one.
  • “My DHCP address is mine forever.” It is lent for the lease time; the client renews at T1 = 50 %.
  • “DHCP resolves IP addresses.” DHCP configures hosts; ARP finds a MAC address for an IP address, DNS an IP address for a name.
  • “169.254.x.y means the Internet provider is down.” It means no DHCP server answered on your own link — start with the cable, the Wi-Fi and the router.
  • “One DHCP server can only serve its own LAN.” With relay agents it serves many LANs.
  • « لەسەر TCP کار دەکات.» لەسەر UDP کار دەکات: ⁦67⁩، ⁦68⁩. بێ ناونیشان ناتوانێت پەیوەندیی TCP بکاتەوە.
  • « ⁦67⁩ هی .» ⁦67⁩ هی و ⁦68⁩ هی .
  • «Request تەنیا بۆ ئەو دەچێت کە هەڵبژێردراوە.» لە ، بۆ ئەوەی تر بزانن هەڵنەبژێردراون. (نوێکردنەوەکانی دواتر لە ⁦T1⁩ ڕاستەوخۆ بۆ دەنێردرێن.)
  • «Offer لیستێکی ناونیشانە بۆ هەڵبژاردن.» هەر Offerـێک یەک ناونیشان هەڵدەگرێت؛ چەند دەتوانن هەریەکە یەکێک بنێرن.
  • «ناونیشانی بۆ هەمیشە هی منە.» بۆ ماوەی کرێکە بە قەرز دراوە؛ لە ⁦T1 = 50%⁩ نوێی دەکاتەوە.
  • « دەدۆزێتەوە.» ڕێک دەخات؛ بۆ دەدۆزێتەوە و بۆ ناوێک.
  • «⁦169.254.x.y⁩ واتە کوژاوەتەوە.» واتە هیچ لەسەر بەستەری خۆت وەڵامی نەدایەوە — لە کێبڵ، و دەست پێ بکە.
  • «یەک تەنیا دەتوانێت خزمەتی خۆی بکات.» بە خزمەتی زۆر دەکات.

Exercisesڕاهێنانەکان

Exerciseڕاهێنان

A server gives 8-day leases. When does a client first try to renew, and when does it start asking any server?

کرێی 8 ڕۆژی دەدات. یەکەم جار کەی هەوڵی نوێکردنەوە دەدات و کەی دەست دەکات بە پرسیار لە هەر ؟

Show answerوەڵامەکە پیشان بدە

T1=0.5×8=4\text{T1} = 0.5 \times 8 = 4: after 4 days (renew with the same server). T2=0.875×8=7\text{T2} = 0.875 \times 8 = 7: after 7 days (rebind with any server). After 8 days without an answer the address must be given up.

T1=0.5×8=4\text{T1} = 0.5 \times 8 = 4: دوای 4 ڕۆژ (نوێکردنەوە لەگەڵ هەمان ). T2=0.875×8=7\text{T2} = 0.875 \times 8 = 7: دوای 7 ڕۆژ (دووپاتە بەستنەوە لەگەڵ هەر ). دوای 8 ڕۆژ بێ وەڵام، دەبێت واز لە ناونیشانەکە بهێنرێت.

Exerciseڕاهێنان

Put the DHCP messages of a full life in order: Request, Release, Discover, Ack, Offer, Request (renewal at T1), Ack.

پەیامەکانی DHCP بۆ ژیانێکی تەواو ڕیز بکە: Request، Release، Discover، Ack، Offer، Request (نوێکردنەوە لە ⁦T1⁩)، Ack.

Show answerوەڵامەکە پیشان بدە

Discover → Offer → Request → Ack → (at T1) Request → Ack → … → Release (when the client is finished with the address).

ڕیزبەندیی دروست: Discover → Offer → Request → Ack؛ پاشان لە ⁦T1⁩دا: Request → Ack (دووپاتە دەبێتەوە)؛ لە کۆتاییدا Release، کاتێک ئیشی بە ناونیشانەکە نامێنێت.

Exerciseڕاهێنان

True or false? (a) DHCP is an application-layer protocol. (b) The Discover is sent to the server’s IP address. (c) A router can be a DHCP server. (d) The Ack tells the client it may use the address.

ڕاست یان هەڵە؟ ⁦(a)⁩ . ⁦(b) Discover⁩ بۆ دەنێردرێت. ⁦(c)⁩ دەتوانێت بێت. ⁦(d) Ack⁩ بە دەڵێت دەتوانێت ناونیشانەکە بەکار بهێنێت.

Show answerوەڵامەکە پیشان بدە
  • (a) True — it runs over UDP 67/68 below it.
  • (b) False — the client does not know it yet; the Discover goes to 255.255.255.255.
  • (c) True — home and small-office routers do it.
  • (d) True — after the Ack the address is leased to the client.
  • ⁦(a)⁩ ڕاستە — لە خوارییەوە لەسەر ⁦UDP 67/68⁩ کار دەکات.
  • ⁦(b)⁩ هەڵەیە — هێشتا نایزانێت؛ Discover دەچێت بۆ ⁦255.255.255.255⁩.
  • ⁦(c)⁩ ڕاستە — ماڵەوە و ئۆفیسی بچووک ئەمە دەکەن.
  • ⁦(d)⁩ ڕاستە — دوای Ack ناونیشانەکە بە کرێ دەدرێتە .
Review questionsپرسیارەکانی پێداچوونەوە
What can a DHCP server give besides the IP address?ڕاژەکاری DHCP جگە لە ناونیشانی IP چی تر دەتوانێت بدات؟

The subnet mask, default gateway, DNS servers, domain name, lease time and many other options.

، ، ، ، ماوەی کرێ و زۆر هەڵبژاردەی تر.

What is the difference between a pool, an exclusion and a reservation?جیاوازیی نێوان پووڵی ناونیشان، جیاکراوە و تەرخانکراو چییە؟

The pool is the range lent to clients; an exclusion is an address the server must never lend; a reservation always gives one address to one MAC address.

پووڵ ئەو ناونیشانانەیە کە بە دەدرێن؛ جیاکراوە ناونیشانێکە کە هەرگیز نابێت بیدات؛ تەرخانکراو هەمیشە یەک ناونیشان دەداتە یەک .

Why is a DHCP relay agent needed in a large network?بۆچی لە ڕایەڵەیەکی گەورەدا گوازەرەوەی DHCP پێویستە؟

Because the Discover is a broadcast that stops at routers; the relay forwards it as a unicast to a central server.

چونکە Discover کە لە دەوەستێت؛ گوازەرەوەکە وەک بۆ ناوەندی دەینێرێت.

Summaryپوختە

  • Every device needs an address, mask, gateway and DNS servers: typed by hand (static) or received from a DHCP server (dynamic).
  • DHCP avoids typing mistakes and duplicate addresses, sets lease times, uses pools and can filter by MAC address.
  • The server can be a router, a server on the LAN or the ISP’s server.
  • DORA: Discover (0.0.0.0:68 → 255.255.255.255:67), Offer, Request (broadcast), Acknowledge.
  • DHCP is an application-layer protocol over UDP: server 67, client 68.
  • A lease is renewed at T1 = 50 % (same server) and rebound at T2 = 87.5 % (any server); ipconfig /release and /renew control it.
  • Pools (scopes), exclusions and reservations by MAC address organise the addresses.
  • No answer → APIPA 169.254.x.y, usable only on the local link.
  • Relay agents carry DHCP across routers; DHCP snooping stops rogue servers.
  • هەموو ئامێرێک پێویستی بە ناونیشان، ، و هەیە: بە دەست نووسراو () یان لە وەرگیراو ().
  • ڕێگە لە هەڵەی نووسین و ناونیشانی دووپاتە دەگرێت، ماوەی کرێ دیاری دەکات، پووڵ بەکار دەهێنێت و دەتوانێت بە جیاکاری بکات.
  • دەتوانێت ، لە یان بێت.
  • : ⁦Discover (0.0.0.0:68 → 255.255.255.255:67)⁩، Offer، Request ()، Acknowledge.
  • لەسەر UDP: ⁦67⁩، ⁦68⁩.
  • لە ⁦T1 = 50%⁩ نوێ دەکرێتەوە (هەمان ) و لە ⁦T2 = 87.5%⁩ دووپاتە دەبەسترێتەوە (هەر )؛ ipconfig /release و /renew کۆنترۆڵی دەکەن.
  • پووڵ ⁦(scope)⁩، جیاکراوە و تەرخانکردن بە ناونیشانەکان ڕێک دەخەن.
  • وەڵام نییە ← ⁦169.254.x.y⁩، تەنیا لەسەر بەستەری ناوخۆیی بەکار دێت.
  • بە تێدەپەڕێنن؛ ناشەرعی ڕادەگرێت.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

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

Web and E-mail Protocols: HTTP, HTTPS, SMTP, POP3 and IMAPپرۆتۆکۆڵەکانی وێب و ئیمەیڵ: HTTP، HTTPS، SMTP، POP3 و IMAP

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.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.