Network Layer
Network Layer
Network Layer
MAHS
Hierarchical Routing
Our routing study thus far - idealization all routers identical network flat not true in practice Why? scale: with 200 million destinations:
cant store all dests in
administrative autonomy
internet = network of
networks each network admin may want to control routing (cost metrics, etc.) in its own network
4: Network Layer 4b-2
Hierarchical Routing
Organization:
gateway routers
special
run intra-AS routing
aggregate routers into regions, called autonomous systems (AS) routers in same AS run same routing protocol
intra-AS routing (i.e., within an AS) protocol routers in different AS can run different intraAS routing protocol
protocol with all other routers in AS also responsible for routing to destinations outside AS run inter-AS routing (i.e., between AS) protocol with other gateway routers
4: Network Layer
4b-3
B.a
c
Gateway routers:
perform inter-AS routing amongst themselves perform intra-AS routing with other routers in their AS
network layer
physical layer
4: Network Layer
4b-4
a Host h1
IP datagram format
IP protocol version number header length (4-byte multiples) DS codepoint, ECN max number remaining hops (decremented at each router) upper layer protocol to deliver payload to (RFC 1700, 3232) 32 bits head. type of length ver len service fragment 16-bit identifier flgs offset upper time to Header layer live checksum 32 bit source IP address 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. total datagram length (bytes) for fragmentation/ reassembly
how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead
data (variable length, typically a TCP segment, a UDP segment, or an ICMP message)
4: Network Layer
4b-6
Transfer Unit) size - largest possible link-level frame. different link types, different MTUs large IP datagram is divided (fragmented) within network one datagram becomes several datagrams reassembled only at the final destination IP header bits are used to identify and order related fragments
reassembly
4: Network Layer
4b-7
Note: Offset is actually specified as number of 8-byte (64-bit) units. 4: Network Layer 4b-8
DHCP overview: host broadcasts DHCP discover msg DHCP server responds with DHCP offer msg host requests IP address: DHCP request msg DHCP server sends address: DHCP ack msg
Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an on Support for mobile users who want to join network (more shortly)
4: Network Layer
4b-9
DHCP server
223.1.2.9
223.1.2.1
arriving client
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
time
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
network have same single source NAT IP address: 138.76.29.7, different source port numbers
Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual)
far as outside word is concerned: no need to be allocated range of addresses from ISP: - just one IP address is used for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus).
every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr.
1
10.0.0.4
S: 128.119.40.186, 80 D: 10.0.0.1, 3345
10.0.0.1
10.0.0.2
138.76.29.7
10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345
4: Network Layer 4b-15
NAT possibility must be taken into account by app designers, eg, P2P applications
Intra-AS Routing
Also known as Interior Gateway Protocols (IGP)
RIP: Routing Information Protocol (legacy, RIPv2 still in use) OSPF: Open Shortest Path First (common) EIGRP: Enhanced Interior Gateway Routing Protocol (proprietary Cisco Systems)
Included in BSD-UNIX Distribution in 1982 RFC 1058 (version 1), RFC 2453 (version 2)
Distance metric: # of hops (max = 15 hops) Can you guess why? Distance vectors: exchanged every 30 seconds via
Response Message (also called advertisement) Each advertisement: routing info for maximum of 25 destination nets within the AS Uses UDP transport, port 520
4: Network Layer 4b-18
1988 IETF initiates work on replacement 1990 OSPF became new standard 1990s RIP version 2
However. OSPF advertisement carries only one entry per neighbor router Advertisements disseminated to entire AS (via flooding) Sent as payload in IP datagram
4: Network Layer 4b-20
load etc) uses TCP (!) to exchange routing updates Loop-free routing via a distributed update routing algorithm (called DUAL) based on diffused
computation
Inter-AS routing