Professional Documents
Culture Documents
Class 3 - Network Layer and Subnetting-B
Class 3 - Network Layer and Subnetting-B
Class 3 - Network Layer and Subnetting-B
Instructor name
Housekeeping Items
• Today please close all laptops until the moment they will be
required for an activity
• The PPTs will be posted after class. Both slides and notes contain
material which will be in the mid-term and final exams
link 2
Network
Access physical 1
Architectural Principles of the
Internet
RFC 1958
“Many members of the Internet community would argue that there is no architecture, but only a tradition,
which was not written down for the first 25 years (or at least not by the IAB). However, in very general terms,
the community believes that the goal is connectivity, the tool is the Internet
Protocol, and the intelligence is end to end rather than hidden in the
network.”
Internet i. successful
Intserv Guaranteed datagram
yes deliveryyes
to destination
yes yes
ii.1633
(RFC )
timing or order of delivery
Internet Diffserv (RFC 2475) available
iii. bandwidth possibleto end-end flow possibly
possibly no
Reflections on best-effort service:
▪ simplicity of mechanism has allowed Internet to be widely deployed
adopted
▪ sufficient provisioning of bandwidth allows performance of real-time
applications (e.g., interactive voice, video) to be “good enough” for
“most of the time”
▪ replicated, application-layer distributed services (datacenters, content
distribution networks) connecting close to clients’ networks, allow
services to be provided from multiple locations
▪ congestion control of “elastic” services helps
223.1.1.2
▪ interface: connection between 223.1.1.4 223.1.2.9
interfaces 223.1.2.2
▪ Private: UNREGISTERED, locally significant, not routed on internet, overlap from one LAN to another LAN, for internal use only
▪
Public & Private ACTIVITY
223 1 1 1
IP Datagram format
32 bits
IP protocol version number total datagram
ver head. type of length length (bytes)
header length(bytes) len service
fragment fragmentation/
“type” of service: 16-bit identifier flgs
▪ diffserv (0:5) offset reassembly
time to upper header
▪ ECN (6:7) header checksum
live layer checksum
TTL: remaining max hops source IP address 32-bit source IP address
(decremented at each router)
destination IP address 32-bit destination IP address
upper layer protocol (e.g., TCP or UDP)
options (if any) e.g., timestamp, record
overhead route taken
▪ 20 bytes of TCP payload data
▪ 20 bytes of IP (variable length, Maximum length: 64K bytes
▪ = 40 bytes + app typically a TCP Typically: 1500 bytes or less
layer overhead for or UDP segment)
TCP+IP
IPv6: motivation
▪ initial motivation: 32-bit IPv4 address space would be completely
allocated
▪ additional motivation:
• speed processing/forwarding: 40-byte fixed length header
• enable different network-layer treatment of “flows”
"Who the hell knew how much address space we needed?" Vint Cerf (reflecting on
decision to make IPv4 address 32 bits long)
IPv6 datagram format
32 bits
(4 bits) set to 6 (20 bits) identify
for IPV6.. BUT datagrams in same
not 4 for IPV4!! "flow.” (concept of
“flow” not well defined).
128-bit
IPv6 addresses
Globally
routable
and
reachable
in the IPv6
internet
https://www.oreilly.com/library/view/ipv6-fundamentals-a/9780134670584/ch05.html
IPv6: adoption ACTIVITY
1. In the US?
1. In France?
https://www.google.com/intl/en/ipv6/statistics.html
Transitioning from IPv4 to IPv6…
September 3rd, 1967 – “H Day”
Transition from IPv4 to IPv6
▪not all routers can be upgraded simultaneously
- no “Day H”: how will network operate with mixed IPv4 and IPv6
routers?
IPv6 datagram
IPv4 datagram
Tunneling
A B IPv4 tunnel E F
connecting IPv6 routers
logical view:
IPv6 IPv6/v4 IPv6/v4 IPv6
A B C D E F
physical view:
IPv6 IPv6/v4 IPv4 IPv4 IPv6/v4 IPv6
A-to-B: E-to-F:
B-to-C: B-to-C: B-to-C:
IPv6 IPv6
IPv6 inside IPv6 inside IPv6 inside
IPv4 IPv4 IPv4
IP addressing...
Q: how does an ISP get block of Q: are there enough 32-bit IP
addresses? addresses?
A: ICANN: Internet Corporation for ▪ ICANN allocated last chunk of
Assigned Names and Numbers IPv4 addresses to RRs in 2011
http://www.icann.org/ ▪ NAT (next) helps IPv4 address
• allocates IP addresses, through 5 space exhaustion
regional registries (RRs) (who may
then allocate to local registries) ▪ IPv6 has 128-bit address space
• manages DNS root zone, including
delegation of individual TLD (.com,
.edu , …) management
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” = “zero-conf”
▪ IPV6 hosts – Stateless Address Autoconfiguration (SLAAC)
On PT: ACTIVITY
BREAK
Return at…
Basic operations of the network layer:
1. Encapsulation and De-encapsulation
2. Addressing end devices
1. Addressing format
2. DHCP
3. Subnetting
4. NAT
3. Forwarding and Routing
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-38
DHCP client-server scenario
Typically, DHCP server will be co-
DHCP server located in router, serving all subnets
223.1.1.1
223.1.2.1
to which router is attached
223.1.2.5
223.1.1.2
223.1.1.4 223.1.2.9
223.1.1.3
223.1.3.27 arriving DHCP client needs
223.1.2.2 address in this network
223.1.3.1 223.1.3.2
DHCP client-server scenario
DHCP server: 223.1.2.5 DHCP discover Arriving client
src : 0.0.0.0, 68
Broadcast: is there a
dest.: 255.255.255.255,67
DHCPyiaddr:
server 0.0.0.0
out there?
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server!
yiaddr:Here’s an IP
223.1.2.4
address you can use
transaction ID: 654
lifetime: 3600 secs
The two steps above can
DHCP request be skipped “if a client
src: 0.0.0.0, 68 remembers and wishes to
Broadcast: OK. I would
dest:: 255.255.255.255, 67 reuse a previously
yiaddr: 223.1.2.4 allocated network address”
like to transaction
use this ID:IP 655
address!
[RFC 2131]
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
Broadcast: OK. You’ve
yiaddr: 223.1.2.4
yiaddr = your internet address got that IPID:address!
transaction 655
lifetime: 3600 secs
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)
subnet 223.1.1/24
223.1.1.1
▪ Not just for 223.1.1.4
hosts
223.1.9.2 223.1.7.0
▪ Interconnected subnet 223.1.9/24
subnet 223.1.7/24
What is the wild card bits address? 00000000 00000000 00000001 11111111
?.?.?.?
ACTIVITY
10.0.0.1
138.76.29.7 10.0.0.4
10.0.0.2
10.0.0.3
all datagrams leaving local network have datagrams with source or destination in
same source NAT IP address: 138.76.29.7, this network have 10.0.0/24 address for
but different source port numbers source, destination (as usual)
NAT: network address translation
▪ 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