SlideShare a Scribd company logo
IP addresses: how to get one?
That’s actually two questions:
1.Q: How does a host get IP address within its network (host part of
address)?
2.Q: How does a network get IP address for itself (network part of
address)
How does host get IP address?
 hard-coded by sysadmin in config file (e.g., /etc/rc.config in UNIX)
 DHCP: Dynamic Host Configuration Protocol: dynamically get address
from as server
• “plug-and-play”
Network Layer: 4-1
DHCP: Dynamic Host Configuration Protocol
goal: host dynamically obtains IP address from network server when it
“joins” network
 can renew its lease on address in use
 allows reuse of addresses (only hold address while
connected/on)
 support for mobile users who join/leave network
DHCP overview:
 host broadcasts DHCP discover msg [optional]
 DHCP server responds with DHCP offer msg [optional]
 host requests IP address: DHCP request msg
 DHCP server sends address: DHCP ack msg
Network Layer: 4-2
DHCP client-server scenario
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2
223.1.3.1
223.1.3.27
DHCP server
223.1.2.5
arriving DHCP client needs
address in this network
Typically, DHCP server will be co-
located in router, serving all subnets
to which router is attached
Network Layer: 4-3
DHCP client-server scenario
DHCP server: 223.1.2.5
Arriving client
DHCP discover
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
Broadcast: is there a
DHCP server out there?
Broadcast: I’m a DHCP
server! Here’s an IP
address you can use
Broadcast: OK. I would
like to use this IP address!
Broadcast: OK. You’ve
got that IP address!
The two steps above can
be skipped “if a client
remembers and wishes to
reuse a previously
allocated network address”
[RFC 2131]
Network Layer: 4-4
DHCP: more than IP addresses
DHCP can return more than just allocated IP address on
subnet:
 address of first-hop router for client
 name and IP address of DNS sever
 network mask (indicating network versus host portion of address)
Network Layer: 4-5
DHCP: example
 Connecting laptop will use DHCP
to get IP address, address of first-
hop router, address of DNS server.
router with DHCP
server built into
router
 DHCP REQUEST message encapsulated
in UDP, encapsulated in IP, encapsulated
in Ethernet
 Ethernet frame broadcast (dest:
FFFFFFFFFFFF) on LAN, received at router
running DHCP server
 Ethernet demux’ed to IP demux’ed,
UDP demux’ed to DHCP
168.1.1.1
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
Network Layer: 4-6
DHCP: example
 DCP server formulates DHCP ACK
containing client’s IP address, IP
address of first-hop router for client,
name & IP address of DNS server
 encapsulated DHCP server reply
forwarded to client, demuxing up to
DHCP at client
router with DHCP
server built into
router
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
 client now knows its IP address, name
and IP address of DNS server, IP
address of its first-hop router
Network Layer: 4-7
IP addresses: how to get one?
Q: how does network get subnet part of IP address?
A: gets allocated portion of its provider ISP’s address space
ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20
ISP can then allocate out its address space in 8 blocks:
Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23
Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. ….
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23
Network Layer: 4-8
IP addressing: last words ...
Q: how does an ISP get block of
addresses?
A: ICANN: Internet Corporation for
Assigned Names and Numbers
http://www.icann.org/
• allocates IP addresses, through 5
regional registries (RRs) (who may
then allocate to local registries)
• manages DNS root zone, including
delegation of individual TLD (.com,
.edu , …) management
Q: are there enough 32-bit IP
addresses?
 ICANN allocated last chunk of
IPv4 addresses to RRs in 2011
 NAT (next) helps IPv4 address
space exhaustion
 IPv6 has 128-bit address space
"Who the hell knew how much address
space we needed?" Vint Cerf (reflecting
on decision to make IPv4 address 32 bits
long)
Network Layer: 4-9
Network layer: “data plane” roadmap
 Network layer: overview
• data plane
• control plane
 What’s inside a router
• input ports, switching, output ports
• buffer management, scheduling
 IP: the Internet Protocol
• datagram format
• addressing
• network address translation
• IPv6
 Generalized Forwarding, SDN
• match+action
• OpenFlow: match+action in action
 Middleboxes
Network Layer: 4-10
10.0.0.1
10.0.0.2
10.0.0.3
10.0.0.4
local network (e.g., home
network) 10.0.0/24
138.76.29.7
rest of
Internet
NAT: network address translation
datagrams with source or destination in
this network have 10.0.0/24 address for
source, destination (as usual)
all datagrams leaving local network have
same source NAT IP address: 138.76.29.7,
but different source port numbers
NAT: all devices in local network share just one IPv4 address as
far as outside world is concerned
Network Layer: 4-11
 all devices in local network have 32-bit addresses in a “private” IP
address space (10/8, 172.16/12, 192.168/16 prefixes) that can only
be used in local network
 advantages:
 just one IP address needed from provider ISP for all devices
 can change addresses of host in local network without notifying
outside world
 can change ISP without changing addresses of devices in local
network
 security: devices inside local net not directly addressable, visible
by outside world
NAT: network address translation
Network Layer: 4-12
implementation: NAT router must (transparently):
 outgoing datagrams: replace (source IP address, port #) of every
outgoing datagram to (NAT IP address, new port #)
• remote clients/servers will respond using (NAT IP address, new port
#) as destination address
 remember (in NAT translation table) every (source IP address, port #)
to (NAT IP address, new port #) translation pair
 incoming datagrams: replace (NAT IP address, new port #) in
destination fields of every incoming datagram with corresponding
(source IP address, port #) stored in NAT table
NAT: network address translation
Network Layer: 4-13
NAT: network address translation
S: 10.0.0.1, 3345
D: 128.119.40.186, 80
1
10.0.0.4
138.76.29.7
1: host 10.0.0.1 sends
datagram to
128.119.40.186, 80
NAT translation table
WAN side addr LAN side addr
138.76.29.7, 5001 10.0.0.1, 3345
…… ……
S: 128.119.40.186, 80
D: 10.0.0.1, 3345
4
S: 138.76.29.7, 5001
D: 128.119.40.186, 80
2
2: NAT router changes
datagram source address
from 10.0.0.1, 3345 to
138.76.29.7, 5001,
updates table
S: 128.119.40.186, 80
D: 138.76.29.7, 5001 3
3: reply arrives, destination
address: 138.76.29.7, 5001
10.0.0.1
10.0.0.2
10.0.0.3
Network Layer: 4-14
 NAT has been controversial:
• routers “should” only process up to layer 3
• address “shortage” should be solved by IPv6
• violates end-to-end argument (port # manipulation by network-layer device)
 but NAT is here to stay:
• extensively used in home and institutional nets, 4G/5G cellular nets
NAT: network address translation
Network Layer: 4-15

More Related Content

PPTX
Internet Service Provider-ISP
PPT
PPTX
Introduction to HTTP protocol
PPTX
Information and network security 9 model for network security
PPT
Dns ppt
PPTX
PDF
E mail protocol - SMTP
PDF
Presentation on Domain Name System
Internet Service Provider-ISP
Introduction to HTTP protocol
Information and network security 9 model for network security
Dns ppt
E mail protocol - SMTP
Presentation on Domain Name System

What's hot (20)

PPTX
DHCP & DNS
PPT
SMTP – Simple Mail Transfer Protocol | Explained for Beginners
PPT
PDF
DNS - Domain Name System
PPTX
Web browser and web servers (WT)
PDF
DNS (Domain Name System)
PPTX
Multicast routing
PPT
PPTX
What is Email Header - Understanding Email Anatomy
PPT
Application layer protocols
PPTX
Virtual Private Network
PPTX
Basic web security model
PDF
DHCP (dynamic host configuration protocol)
PPT
Chapter03 Creating And Managing User Accounts
PPTX
Wireless application protocol
KEY
Bug Bounty Programs For The Web
PPTX
HTTP request and response
PDF
IT6601 MOBILE COMPUTING
PPT
Wi fi protected access
DHCP & DNS
SMTP – Simple Mail Transfer Protocol | Explained for Beginners
DNS - Domain Name System
Web browser and web servers (WT)
DNS (Domain Name System)
Multicast routing
What is Email Header - Understanding Email Anatomy
Application layer protocols
Virtual Private Network
Basic web security model
DHCP (dynamic host configuration protocol)
Chapter03 Creating And Managing User Accounts
Wireless application protocol
Bug Bounty Programs For The Web
HTTP request and response
IT6601 MOBILE COMPUTING
Wi fi protected access
Ad

Similar to Lecture 23 DHCP and NAT.pptx (20)

PPTX
Computer Networking: A Top-Down Approach
PDF
net work iTM3
PDF
MULTIMEDIA COMMUNICATION & NETWORKS
PPT
DNS_CN_CN_____________________-_____.ppt
PPTX
IP, DNS and MAC concepts
PPT
Ccna1v3 Mod09
PPT
PDF
Configurar dhcp en router cisco
PPTX
06 coms 525 tcpip - dhcp and dns
PPTX
2 logical addressing
PDF
Clase 1 Direccionamiento IPv4.pdf
PPTX
DHCP DNS P1 DHCP & Wireless Communication Methods Unicasting.pptx
PPT
Tcp ip protocol
PPT
Ccna1v3 mod09
PPT
IP Addressing.ppt
PDF
Apnic-Training-IPv6_workshop
DOCX
Bt0076, tcp ip
DOCX
Bt0076, tcp ip
Computer Networking: A Top-Down Approach
net work iTM3
MULTIMEDIA COMMUNICATION & NETWORKS
DNS_CN_CN_____________________-_____.ppt
IP, DNS and MAC concepts
Ccna1v3 Mod09
Configurar dhcp en router cisco
06 coms 525 tcpip - dhcp and dns
2 logical addressing
Clase 1 Direccionamiento IPv4.pdf
DHCP DNS P1 DHCP & Wireless Communication Methods Unicasting.pptx
Tcp ip protocol
Ccna1v3 mod09
IP Addressing.ppt
Apnic-Training-IPv6_workshop
Bt0076, tcp ip
Bt0076, tcp ip
Ad

More from HanzlaNaveed1 (8)

PPTX
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
PPTX
Lecture 22 What inside the Router.pptx
PPTX
Lecture-3 Relational Algebra I.pptx
PPTX
Lecture-2 - Relational Model.pptx
PPTX
Lecture 06 and 07.pptx
PPTX
Lecture 26 Link Layer .pptx
PPTX
Lecture 19 and 20 IP Addressing.pptx
PPT
Lecture 05 OSI Model and IP Protocol Suite.ppt
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 22 What inside the Router.pptx
Lecture-3 Relational Algebra I.pptx
Lecture-2 - Relational Model.pptx
Lecture 06 and 07.pptx
Lecture 26 Link Layer .pptx
Lecture 19 and 20 IP Addressing.pptx
Lecture 05 OSI Model and IP Protocol Suite.ppt

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPT
Introduction Database Management System for Course Database
PPTX
Introduction to Artificial Intelligence
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
history of c programming in notes for students .pptx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Nekopoi APK 2025 free lastest update
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
ManageIQ - Sprint 268 Review - Slide Deck
2025 Textile ERP Trends: SAP, Odoo & Oracle
Navsoft: AI-Powered Business Solutions & Custom Software Development
Odoo Companies in India – Driving Business Transformation.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
How Creative Agencies Leverage Project Management Software.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
ISO 45001 Occupational Health and Safety Management System
Softaken Excel to vCard Converter Software.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Introduction Database Management System for Course Database
Introduction to Artificial Intelligence
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms II-SECS-1021-03
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
history of c programming in notes for students .pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...

Lecture 23 DHCP and NAT.pptx

  • 1. IP addresses: how to get one? That’s actually two questions: 1.Q: How does a host get IP address within its network (host part of address)? 2.Q: How does a network get IP address for itself (network part of address) How does host get IP address?  hard-coded by sysadmin in config file (e.g., /etc/rc.config in UNIX)  DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server • “plug-and-play” Network Layer: 4-1
  • 2. DHCP: Dynamic Host Configuration Protocol goal: host dynamically obtains IP address from network server when it “joins” network  can renew its lease on address in use  allows reuse of addresses (only hold address while connected/on)  support for mobile users who join/leave network DHCP overview:  host broadcasts DHCP discover msg [optional]  DHCP server responds with DHCP offer msg [optional]  host requests IP address: DHCP request msg  DHCP server sends address: DHCP ack msg Network Layer: 4-2
  • 3. DHCP client-server scenario 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 DHCP server 223.1.2.5 arriving DHCP client needs address in this network Typically, DHCP server will be co- located in router, serving all subnets to which router is attached Network Layer: 4-3
  • 4. DHCP client-server scenario DHCP server: 223.1.2.5 Arriving client DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs Broadcast: is there a DHCP server out there? Broadcast: I’m a DHCP server! Here’s an IP address you can use Broadcast: OK. I would like to use this IP address! Broadcast: OK. You’ve got that IP address! The two steps above can be skipped “if a client remembers and wishes to reuse a previously allocated network address” [RFC 2131] Network Layer: 4-4
  • 5. DHCP: more than IP addresses DHCP can return more than just allocated IP address on subnet:  address of first-hop router for client  name and IP address of DNS sever  network mask (indicating network versus host portion of address) Network Layer: 4-5
  • 6. DHCP: example  Connecting laptop will use DHCP to get IP address, address of first- hop router, address of DNS server. router with DHCP server built into router  DHCP REQUEST message encapsulated in UDP, encapsulated in IP, encapsulated in Ethernet  Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server  Ethernet demux’ed to IP demux’ed, UDP demux’ed to DHCP 168.1.1.1 DHCP UDP IP Eth Phy DHCP DHCP DHCP DHCP DHCP DHCP UDP IP Eth Phy DHCP DHCP DHCP DHCP DHCP Network Layer: 4-6
  • 7. DHCP: example  DCP server formulates DHCP ACK containing client’s IP address, IP address of first-hop router for client, name & IP address of DNS server  encapsulated DHCP server reply forwarded to client, demuxing up to DHCP at client router with DHCP server built into router DHCP DHCP DHCP DHCP DHCP UDP IP Eth Phy DHCP DHCP UDP IP Eth Phy DHCP DHCP DHCP DHCP  client now knows its IP address, name and IP address of DNS server, IP address of its first-hop router Network Layer: 4-7
  • 8. IP addresses: how to get one? Q: how does network get subnet part of IP address? A: gets allocated portion of its provider ISP’s address space ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20 ISP can then allocate out its address space in 8 blocks: Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23 ... ….. …. …. Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23 Network Layer: 4-8
  • 9. IP addressing: last words ... Q: how does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers http://www.icann.org/ • allocates IP addresses, through 5 regional registries (RRs) (who may then allocate to local registries) • manages DNS root zone, including delegation of individual TLD (.com, .edu , …) management Q: are there enough 32-bit IP addresses?  ICANN allocated last chunk of IPv4 addresses to RRs in 2011  NAT (next) helps IPv4 address space exhaustion  IPv6 has 128-bit address space "Who the hell knew how much address space we needed?" Vint Cerf (reflecting on decision to make IPv4 address 32 bits long) Network Layer: 4-9
  • 10. Network layer: “data plane” roadmap  Network layer: overview • data plane • control plane  What’s inside a router • input ports, switching, output ports • buffer management, scheduling  IP: the Internet Protocol • datagram format • addressing • network address translation • IPv6  Generalized Forwarding, SDN • match+action • OpenFlow: match+action in action  Middleboxes Network Layer: 4-10
  • 11. 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 local network (e.g., home network) 10.0.0/24 138.76.29.7 rest of Internet NAT: network address translation datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) all datagrams leaving local network have same source NAT IP address: 138.76.29.7, but different source port numbers NAT: all devices in local network share just one IPv4 address as far as outside world is concerned Network Layer: 4-11
  • 12.  all devices in local network have 32-bit addresses in a “private” IP address space (10/8, 172.16/12, 192.168/16 prefixes) that can only be used in local network  advantages:  just one IP address needed from provider ISP for all devices  can change addresses of host in local network without notifying outside world  can change ISP without changing addresses of devices in local network  security: devices inside local net not directly addressable, visible by outside world NAT: network address translation Network Layer: 4-12
  • 13. implementation: NAT router must (transparently):  outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) • remote clients/servers will respond using (NAT IP address, new port #) as destination address  remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair  incoming datagrams: replace (NAT IP address, new port #) in destination fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table NAT: network address translation Network Layer: 4-13
  • 14. NAT: network address translation S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 10.0.0.4 138.76.29.7 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… …… S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 2 2: NAT router changes datagram source address from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table S: 128.119.40.186, 80 D: 138.76.29.7, 5001 3 3: reply arrives, destination address: 138.76.29.7, 5001 10.0.0.1 10.0.0.2 10.0.0.3 Network Layer: 4-14
  • 15.  NAT has been controversial: • routers “should” only process up to layer 3 • address “shortage” should be solved by IPv6 • violates end-to-end argument (port # manipulation by network-layer device)  but NAT is here to stay: • extensively used in home and institutional nets, 4G/5G cellular nets NAT: network address translation Network Layer: 4-15