Overview r The Internet IP Protocol Datagram format

  • Slides: 24
Download presentation
Overview r The Internet (IP) Protocol Datagram format m IP fragmentation m ICMP: Internet

Overview r The Internet (IP) Protocol Datagram format m IP fragmentation m ICMP: Internet Control Message Protocol m NAT: Network Address Translation r Routing in the Internet m Intra-AS routing: RIP and OSPF m Inter-AS routing: BGP r Multicast Routing m Some slides are in courtesy of J. Kurose and K. Ross

IP addressing: CIDR r Classful addressing: m m inefficient use of address space, address

IP addressing: CIDR r Classful addressing: m m inefficient use of address space, address space exhaustion e. g. , class B net allocated enough addresses for 65 K hosts, even if only 2 K hosts in that network r CIDR: Classless Inter. Domain Routing m m network portion of address of arbitrary length address format: a. b. c. d/x, where x is # bits in network portion of address network part host part 11001000 00010111 00010000 200. 23. 16. 0/23

Hierarchical addressing: route aggregation Hierarchical addressing allows efficient advertisement of routing information: Organization 0

Hierarchical addressing: route aggregation Hierarchical addressing allows efficient advertisement of routing information: Organization 0 200. 23. 16. 0/23 Organization 1 200. 23. 18. 0/23 Organization 2 200. 23. 20. 0/23 Organization 7 . . . Fly-By-Night-ISP “Send me anything with addresses beginning 200. 23. 16. 0/20” Internet 200. 23. 30. 0/23 ISPs-R-Us “Send me anything with addresses beginning 199. 31. 0. 0/16”

Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1

Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1 Organization 0 200. 23. 16. 0/23 Organization 2 200. 23. 20. 0/23 Organization 7 . . . Fly-By-Night-ISP “Send me anything with addresses beginning 200. 23. 16. 0/20” Internet 200. 23. 30. 0/23 ISPs-R-Us Organization 1 200. 23. 18. 0/23 “Send me anything with addresses beginning 199. 31. 0. 0/16 or 200. 23. 18. 0/23”

IP datagram format IP protocol version number header length (bytes) “type” of data max

IP datagram format IP protocol version number header length (bytes) “type” of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to how much overhead with TCP? r 20 bytes of TCP r 20 bytes of IP r = 40 bytes + app layer overhead 32 bits ver head. type of len service length fragment 16 -bit identifier flgs offset upper time to Internet layer live checksum total datagram length (bytes) for fragmentation/ reassembly 32 bit source IP address 32 bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) E. g. timestamp, record route taken, specify list of routers to visit.

IP Fragmentation & Reassembly r network links have MTU (max. transfer size) - largest

IP Fragmentation & Reassembly r network links have MTU (max. transfer size) - largest possible link-level frame. m different link types, different MTUs r large IP datagram divided (“fragmented”) within net m one datagram becomes several datagrams m “reassembled” only at final destination m IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams reassembly

IP Fragmentation and Reassembly Example r 4000 byte datagram r MTU = 1500 bytes

IP Fragmentation and Reassembly Example r 4000 byte datagram r MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 length ID fragflag offset =4000 =x =0 =0 One large datagram becomes several smaller datagrams length ID fragflag offset =1500 =x =1 =0 length ID fragflag offset =1500 =x =1 =185 length ID fragflag offset =1040 =x =0 =370

ICMP: Internet Control Message Protocol r used by hosts, routers, gateways to communication network-level

ICMP: Internet Control Message Protocol r used by hosts, routers, gateways to communication network-level information m error reporting: unreachable host, network, port, protocol m echo request/reply (used by ping) r network-layer “above” IP: m ICMP msgs carried in IP datagrams r Ping, traceroute uses ICMP

Getting a datagram from source to dest. forwarding table in A Dest. Net. next

Getting a datagram from source to dest. forwarding table in A Dest. Net. next router Nhops 223. 1. 1 223. 1. 2 223. 1. 3 IP datagram: misc source dest fields IP addr data A r datagram remains unchanged, as it travels source to destination r addr fields of interest here B 223. 1. 1. 4 1 2 2 223. 1. 1. 1 223. 1. 1. 2 223. 1. 1. 4 223. 1. 1. 3 223. 1. 2. 9 223. 1. 3. 27 223. 1. 2. 2 223. 1. 3. 2 E

Getting a datagram from source to dest. forwarding table in A misc data fields

Getting a datagram from source to dest. forwarding table in A misc data fields 223. 1. 1. 1 223. 1. 1. 3 Dest. Net. next router Nhops 223. 1. 1 223. 1. 2 223. 1. 3 Starting at A, send IP datagram addressed to B: r look up net. address of B in forwarding table r find B is on same net. as A r link layer will send datagram directly to B inside link-layer frame m B and A are directly connected A B 223. 1. 1. 4 1 2 2 223. 1. 1. 1 223. 1. 1. 2 223. 1. 1. 4 223. 1. 1. 3 223. 1. 2. 9 223. 1. 3. 27 223. 1. 2. 2 223. 1. 3. 2 E

Getting a datagram from source to dest. forwarding table in A misc data fields

Getting a datagram from source to dest. forwarding table in A misc data fields 223. 1. 1. 1 223. 1. 2. 3 Dest. Net. next router Nhops 223. 1. 1 223. 1. 2 223. 1. 3 Starting at A, dest. E: r look up network address of E r r r in forwarding table E on different network m A, E not directly attached routing table: next hop router to E is 223. 1. 1. 4 link layer sends datagram to router 223. 1. 1. 4 inside linklayer frame datagram arrives at 223. 1. 1. 4 continued…. . A B 223. 1. 1. 4 1 2 2 223. 1. 1. 1 223. 1. 1. 2 223. 1. 1. 4 223. 1. 1. 3 223. 1. 2. 9 223. 1. 3. 27 223. 1. 2. 2 223. 1. 3. 2 E

Getting a datagram from source to dest. misc data fields 223. 1. 1. 1

Getting a datagram from source to dest. misc data fields 223. 1. 1. 1 223. 1. 2. 3 Arriving at 223. 1. 4, destined for 223. 1. 2. 2 r look up network address of E in router’s forwarding table r E on same network as router’s interface 223. 1. 2. 9 m router, E directly attached r link layer sends datagram to 223. 1. 2. 2 inside link-layer frame via interface 223. 1. 2. 9 r datagram arrives at 223. 1. 2. 2!!! (hooray!) forwarding table in router Dest. Net router Nhops interface 223. 1. 1 223. 1. 2 223. 1. 3 A B - 1 1 1 223. 1. 1. 4 223. 1. 2. 9 223. 1. 3. 27 223. 1. 1. 1 223. 1. 1. 2 223. 1. 1. 4 223. 1. 1. 3 223. 1. 2. 9 223. 1. 3. 27 223. 1. 2. 2 223. 1. 3. 2 E

NAT: Network Address Translation rest of Internet local network (e. g. , home network)

NAT: Network Address Translation rest of Internet local network (e. g. , home network) 10. 0. 0/24 10. 0. 0. 1 10. 0. 0. 2 138. 76. 29. 7 10. 0. 0. 3 All datagrams leaving local 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)

NAT: Network Address Translation r Motivation: local network uses just one IP address as

NAT: Network Address Translation r Motivation: local network uses just one IP address as far as outside word is concerned: m no need to be allocated range of addresses from ISP: - just one IP address is used for all devices m can change addresses of devices in local network without notifying outside world m can change ISP without changing addresses of devices in local network m devices inside local net not explicitly addressable, visible by outside world (a security plus).

NAT: Network Address Translation Implementation: NAT router must: m outgoing datagrams: replace (source IP

NAT: Network Address Translation Implementation: NAT router must: m 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 addr. m remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair m incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

NAT: Network Address Translation 2: NAT router changes datagram source addr from 10. 0.

NAT: Network Address Translation 2: NAT router changes datagram source addr from 10. 0. 0. 1, 3345 to 138. 76. 29. 7, 5001, updates table 2 NAT translation table WAN side addr LAN side addr 1: host 10. 0. 0. 1 sends datagram to 128. 119. 40, 80 138. 76. 29. 7, 5001 10. 0. 0. 1, 3345 …… …… S: 10. 0. 0. 1, 3345 D: 128. 119. 40. 186, 80 S: 138. 76. 29. 7, 5001 D: 128. 119. 40. 186, 80 138. 76. 29. 7 S: 128. 119. 40. 186, 80 D: 138. 76. 29. 7, 5001 3: Reply arrives dest. address: 138. 76. 29. 7, 5001 3 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 4 10. 0. 0. 3 4: NAT router changes datagram dest addr from 138. 76. 29. 7, 5001 to 10. 0. 0. 1, 3345

NAT: Network Address Translation r 16 -bit port-number field: m 60, 000 simultaneous connections

NAT: Network Address Translation r 16 -bit port-number field: m 60, 000 simultaneous connections with a single LAN-side address! r NAT is controversial: m routers should only process up to layer 3 m violates end-to-end argument • NAT possibility must be taken into account by app designers, eg, P 2 P applications m address IPv 6 shortage should instead be solved by

Overview r The Internet (IP) Protocol Datagram format m IP fragmentation m ICMP: Internet

Overview r The Internet (IP) Protocol Datagram format m IP fragmentation m ICMP: Internet Control Message Protocol m NAT: Network Address Translation r Routing in the Internet m Intra-AS routing: RIP and OSPF m Inter-AS routing: BGP r Multicast Routing m Some slides are in courtesy of J. Kurose and K. Ross

Architecture of Dynamic Routing IGP EGP (= BGP) AS 1 IGP = Interior Gateway

Architecture of Dynamic Routing IGP EGP (= BGP) AS 1 IGP = Interior Gateway Protocol Metric based: OSPF, IS-IS, RIP, EIGRP (cisco) IGP AS 2 EGP = Exterior Gateway Protocol Policy based: BGP The Routing Domain of BGP is the entire Internet

The Gang of Four Link State Used in upper-tier ISPs IGP EGP OSPF IS-IS

The Gang of Four Link State Used in upper-tier ISPs IGP EGP OSPF IS-IS Vectoring Lower-tier ISPs and enterprise networks RIP BGP

OSPF (Open Shortest Path First) r “open”: publicly available r Uses Link State algorithm

OSPF (Open Shortest Path First) r “open”: publicly available r Uses Link State algorithm m LS packet dissemination m Topology map at each node m Route computation using Dijkstra’s algorithm r OSPF advertisement carries one entry per neighbor router (per link) r Advertisements disseminated to entire AS (via flooding) m m Periodically broadcast even when there is no link cost change Carried in OSPF messages directly over IP (rather than TCP or UDP

OSPF “advanced” features (not in RIP) r Security: all OSPF messages authenticated (to prevent

OSPF “advanced” features (not in RIP) r Security: all OSPF messages authenticated (to prevent malicious intrusion) r Multiple same-cost paths allowed (only one path in RIP) r Integrated uni- and multicast support: m Multicast OSPF (MOSPF) uses same topology data base as OSPF r Hierarchical OSPF in large domains.

Hierarchical OSPF

Hierarchical OSPF

Hierarchical OSPF r Two-level hierarchy: local area, backbone. m Link-state advertisements only in area

Hierarchical OSPF r Two-level hierarchy: local area, backbone. m Link-state advertisements only in area m each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. r Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. r Backbone routers: run OSPF routing limited to backbone. r Boundary routers: connect to other AS’s.