Download Internetworking: IP Addressing, Routing, and Protocols - Prof. Gerald A. Marin and more Study notes Computer Systems Networking and Telecommunications in PDF only on Docsity! Network Analysis: Internetworking 4 - 1 Network Layer This material is provided only for the use of students in CSE5231 at FIT. Many of the slides were provided with the text Computer Networking by Kurose and Ross, Addison Wesley . Classroom use is generously supported but further use or distribution may be a violation of existing copyright protection. Network Analysis: Internetworking 4 - 2 Definitions Internetwork or internet An arbitrary collection of “networks” that are interconnected to provide a packet delivery service. Network Either a direct-link network as studied earlier or a switched network that (for now) uses one type of technology (ATM, Frame Relay, Ethernet, Token Ring, etc.) to forward cells or frames. The Internet is the global network based on use of the Internet Protocol to route datagrams. Network Analysis: Internetworking 4 - 5 Datagram networks: the Internet model datagram forwarding is sometimes called “routing” no call setup at network layer routers: no state about end-to-end connections no network-level concept of “connection” packets typically routed using destination host ID packets between same source-dest pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data Network Analysis: Internetworking 4 - 6 IP Addressing: introduction IP address: 32-bit identifier for host, router interface interface: connection between host, router and physical link router’s typically have multiple interfaces host may have multiple interfaces (usually one) IP addresses associated with interface, not host, router 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.2223.1.3.1 223.1.3.27 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 11 Network Analysis: Internetworking 4 - 7 IP Addressing IP address: network part (high order bits) host part (low order bits) What’s a network ? (from IP address perspective) device interfaces having same network part of IP address can physically reach each other without intervening router 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.2223.1.3.1 223.1.3.27 network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) LAN ICANN Domain Names To reach another person on the Internet you have to type an address into your computer - a name or a number. That address has to be unique so computers know where to find each other. ICANN coordinates these unique identifiers across the world. Without that coordination we wouldn't have one global Internet. ICANN is responsible for the global coordination of the Internet's system of unique identifiers like domain names (like .org, .museum and country codes like .uk) and the addresses used in a variety of Internet protocols that help computers reach each other over the Internet. So, what has ICANN done in the past decade? Back in 1998, there was a single registrar, charging $50 a year for domain names; now there are over 900 ICANN-accredited registrars 1 and a domain costs from just $6 2 Helped the domain name system grow from roughly three million domains a decade ago to over 160 million today 3 Expanded the Internet's generic top-level domains from three (dotcom, dotnet and dotorg) to 16, including .info, .biz, .cat, .asia, .mobi and .name 4 Seen over 35,000 domains go through the Uniform Dispute Resolution Process 5, a faster, cheaper and more efficient alternative to the law courts for ownership disputes Developed policies with the full involvement of governments, business, the technical community and individual Net users that make the Internet's addressing system able to adapt to the radical new uses that the network is put to every year Network Analysis: Internetworking 4 - 10 Network Analysis: Internetworking 4 - 11 IP Addresses 0network host 10 network host 110 network host 1110 multicast address A B C D class 1.0.0.0 to 127.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 32 bits given notion of “network”, let’s examine IP addresses: Network Analysis: Internetworking 4 - 12 Base Number of Available Host IDs Class A: Class B: Class C: 242 2 16, 777, 214.− = 162 2 65,534.− = 82 2 254.− = Network Analysis: Internetworking 4 - 15 Subnetting • Classes A,B,C designed with two level hierarchy in mind •Network ID •Host ID • Consider UCF with Class B Network address: 132.170.0.0 •Without subnet idea only a single flat network with at most 162 2 65,534− = host addresses. • Imagine the router tables! • To fix this problem we introduce a 3-level hierarchical IDs: • Network ID • Subnet ID • Host ID • Use “subnet mask” of all 1’s covering Network ID plus Subnet ID • network or subnet address results from bit-wise “and” operation on subnet mask plus IP address. Subnet Example
-57.0
192.68.189.0 _.82.0 R57
52.0 530 540 |.55.0 58.0 60.0
R192 R82
j
\ > R52 | | R53 R54 [Rss | R58 | R60
S a I
310 EPNO S10
T
1
I
1
140.252.104.1 gate] : sol-]
Internet - —— = = = 4 ioe met
way aris|
14 1.0 1,92 -1.32
Al -1.183
R2 R3 sores | Re: Re | | R7 R8 R10 netb
A | :
3.54 2 \
2.0 3.0 4.0 6.0 7.0 8.0 30 «800 “Iho es
42°90, *
__|.13.65 |
slipt—“y3 gg[psai| |svr4 sun x2 |
13.35 | 13.34 -13.33
-13.0 -12.0
Network Analysis: Internetworking 4-16
Network Analysis: Internetworking 4 - 17 Routing Table Comparisons • In this example, the route table entry/mask does not match destination address and router examines next entry. • If dest@ = 140.252.1.5, the router will determine there is a match. • Router will forward based on the longest such match. • If the router has an interface directly on the (sub)network, the table entry must instruct the router to send through that interface directly to the destination. • If the router has no interface directly on the (sub)network, the table entry must instruct the router to send to the next router. • There MUST be a matching entry (or default entry) in the table. Table Entry Destination Address Network Analysis: Internetworking 4 - 20 Getting a datagram from source to dest. 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.2223.1.3.1 223.1.3.27 A B E Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 Starting at A, dest. E: look up network address of E E on different network 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 link- layer frame datagram arrives at 223.1.1.4 continued….. misc fields 223.1.1.1 223.1.2.2 data Network Analysis: Internetworking 4 - 21 Getting a datagram from source to dest. 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.2223.1.3.1 223.1.3.27 A B E Arriving at 223.1.4, destined for 223.1.2.2 look up network address of E E on same network as router’s interface 223.1.2.9 router, E directly attached link layer sends datagram to 223.1.2.2 inside link-layer frame via interface 223.1.2.9 datagram arrives at 223.1.2.2!!! (hooray!) misc fields 223.1.1.1 223.1.2.2 data network router Nhops interface 223.1.1 - 1 223.1.1.4 223.1.2 - 1 223.1.2.9 223.1.3 - 1 223.1.3.27 Dest. next Network Analysis: Internetworking 4 - 22 How routers determine next hop Determine best match in the routing table (longest prefix match) If router does not have an interface directly on the (sub)network, it forwards packet to next router. If router does have an interface directly on the destination (sub)network, it forwards packet directly to destination host. Router uses “subnet mask” to determine which bits it should use in matching the destination address to the routing table entry. Network Analysis: Internetworking 4 - 25 130.5.110.2 100.5.10.2 100.5.10.4 100.5.10.6 130.5.10.4 100.5.20.2 100.5.20.4 Eth2 Eth0 Eth1 92.15.10.12 92.5.10.2 92.10.10.2 92.5.10.4 92.10.10.2 92.5.10.6 92.15.10.2 90.60.1.1 90.60.1.2 Eth3 Assign IP addresses to Eth0-Eth2. Using these and the IP addresses shown in the diagram, create a routing table for the upper left router. The routing table must contain exactly five rows with IP address, subnet mask, next and be sufficient to support communication among all IP addresses shown. Network Analysis: Internetworking 4 - 26 Routing Table Network Subnet Mask Next 100.5.10.0 255.255.255.0 Eth0/100.5.10.1 100.5.20.0 255.255.255.0 Eth1/100.5.20.1 130.5.0.0 255.255.0.0 Eth2/130.5.10.1 90.60.1.0 255.255.255.0 Eth3 92.0.0.0 255.0.0.0 90.60.1.1 Network Analysis: Internetworking 4 - 27 Subnets NOT on byte boundary Example: Class C Subnet • An organization with a Class C address has one physical network available with 254 hosts. • What if it needs 6 subnetworks? • Use 3 bits to cover subnet ID in the subnet mask (enables 6 subnets) • Leaves 5 bits for hosts per subnet or 30 host IDs. • Example: Network address: 223.50.20.0 • subnet mask 255.255.255.224 or 11111111 11111111 11111111 11100000 • preferred subnet IDs: 32,64,96,128,160,192 • preferred subnet addresses: •223.50.20.32 (host @: 223.50.20.33 – 223.50.20.62) •223.50.20.64 (host @: 223.50.20.65 – 223.50.20.94) •223.50.20.96 (host @: 223.50.20.97 – 223.50.20.126) •223.50.20.128 (host @: 223.50.20.129 – 223.50.20.158) •223.50.20.160 (host @: 223.50.20.161 – 223.50.20.190) •223.50.20.192 (host @: 223.50.20.193 – 223.50.20.222) Network Analysis: Internetworking 4 - 30 Alternative address format 11001000 00010111 00010000 00000000 network part host part 200.23.16.0/23 address format: a.b.c.d/x, where x is # bits in network portion of address Network Analysis: Internetworking 4 - 31 IP addresses: how host gets one? Hosts (host portion): hard-coded by system admin in a file DHCP: Dynamic Host Configuration Protocol: dynamically get address: “plug-and-play” 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 Network Analysis: Internetworking 4 - 32 IP addresses: how to get one? Network (network portion): get allocated portion of ISP’s address space: ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20 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 Analysis: Internetworking 4 - 35 IP addressing: the last word... Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes Network Analysis: Internetworking 4 - 36 ARP Example: Local Destination Host E1 wants to send to
[email protected] Lookup done by DNS to get 192.31.65.5. E1 broadcasts only on local LAN the ARP request: "Who own's 192.31.65.5?" Each NIC will accept the broadcast on MAC and check it's IP address. Only E2 responds with its MAC @. E1 then puts the original IP datagram inside Ethernet Frame adressed to MAC @ of E2. Optimizations: (a) E1 stores info for a time. (b) E1 includes own IP/MAC map in ARP and all stations can copy. (c) Each machine can ARP itself when boots and all stations can copy. Network Analysis: Internetworking 4 - 37 ARP Example (distant destination) Host E1 wants to send to E6. ARP PROXY: CS Router E3 configured to respond to all ARP requests for 192.31.63.0 with its own IP @ 192.31.65.1. E1 then caches 192.31.65.1/E6. Simpler: E1 sees that E6 on distant subnet and it is configured to send all such traffic to E3. Either way: IP packet is sent to E3 and E3 looks up the destination IP address. Routing table says send to 192.31.60.7. E3 will ARP on FDDI if necessary to get MAC @. Router E4 receives and looks up destination address in routing table to get hostid. Note that E4 can also send ARP request on the EE Ethernet if necessary to get E6 Mac @. Network Analysis: Internetworking 4 - 40 IP Fragmentation and Reassembly ID =x offset =0 fragflag =0 length =4000 ID =x offset =0 fragflag =1 length =1500 ID =x offset =185 fragflag =1 length =1500 ID =x offset =370 fragflag =0 length =1040 One large datagram becomes several smaller datagrams Total length Of datagram. Data=3980. 185x8=1480 Data =1480 Data =1480 Data =1020 370x8=2960 MTU=1500 Network Analysis: Internetworking 4 - 41 The Internet Network layer routing table Host, router network layer functions: Routing protocols •path selection •RIP, OSPF, BGP IP protocol •addressing conventions •datagram format •packet handling conventions ICMP protocol •error reporting •router “signaling” Transport layer: TCP, UDP Link layer physical layer Network layer Network Analysis: Internetworking 4 - 42 ICMP: Internet Control Message Protocol used by hosts, routers, gateways to communication network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer “above” IP: ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 5 0 redirect (host change route) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header 30 0 traceroute Network Analysis: Internetworking 4 - 45 Intra-AS Routing Also known as Interior Gateway Protocols (IGP) Most common IGPs: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco propr.) IGPs use a routing metric to choose an optimal path: administrative cost, hop count, throughput, delay, … Network Analysis: Internetworking 4 - 46 Next-hop Routing Table Basics IP Routing Tables Usually Have 7 Fields: 1. Mask: applied to dest IP@ to find network/subnet address of dest. 2. Either destination host-specific or network-specific address. 3. Next hop address: IP@ of next-hop router. 4. Flags: • U – router is up • G – destination is another network (not this one) • H – destination is a host-specific address • D – destination added by ICMP redirection • M – destination modified by ICMP redirection 5. Reference count: number of users using route at this moment 6. Use: Number of packets transmitted to destination by this router 7. Interface: Name of the network interface Network Analysis: Internetworking 4 - 47 Routing Table example (continued) Three attached class C networks (LANs) Router only knows routes to attached LANs Default router used for other destinations Route multicast address: 224.0.0.0 Loopback interface (for debugging) Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- 127.0.0.1 127.0.0.1 UH 0 26492 lo0 192.168.2. 192.168.2.5 U 2 13 fa0 193.55.114. 193.55.114.6 U 3 58503 le0 192.168.3. 192.168.3.5 U 2 25 qaa0 224.0.0.0 193.55.114.6 U 3 0 le0 default 193.55.114.129 UG 0 143454 Network Analysis: Internetworking 4 - 50 Routing Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links link cost: delay, $ cost, or congestion level Goal: determine “good” path (sequence of routers) thru network from source to dest. Routing protocol A ED CB F 2 2 1 3 1 1 2 5 3 5 “good” path: typically means minimum cost path other def’s possible Network Analysis: Internetworking 4 - 51 Major Routing Algorithm Types Link-State Routing Distance-Vector Routing Policy-Based Routing Network Analysis: Internetworking 4 - 52 A Link-State Routing Algorithm Dijkstra’s algorithm net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (‘source”) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k dest.’s Notation: c(i,j): link cost from node i to j. cost infinite if not direct neighbors D(v): current value of cost of path from source to dest. V p(v): predecessor node along path from source to v, that is next v N: set of nodes whose least cost path definitively known Network Analysis: Internetworking 4 - 55 Distance Vector Routing Each r out er m aint ains t able o f: Best know n dist ance t o each dest inat ion r out er W hich link t o use t o go t her e Rout er updat es t able by exchanging info r m at ion w it h it s neighbo r s Each sends a vect o r o f dist ances; hence, "dist ance vect o r " r o ut ing H ow o ft en? W hich met r ic? (queue lengt h, delay, hops) M ust met r ic be measur ed? Network Analysis: Internetworking 4 - 56 Distance Vector Routing Algorithm iterative: continues until no nodes exchange info. self-terminating: no “signal” to stop asynchronous: nodes need not exchange info/iterate in lock step! distributed: each node communicates only with directly-attached neighbors Distance Table data structure each node has its own row for each possible destination column for each directly- attached neighbor to node example: in node X, for dest. Y via neighbor Z: Network Analysis: Internetworking 4 - 57 Distance Vector Table at Rtr J Network Analysis: Internetworking 4 - 60 Hierarchical Routing scale: with 50 million destinations: can’t store all dest’s in routing tables! routing table exchange would swamp links! administrative autonomy internet = network of networks each network admin may want to control routing in its own network Our routing study thus far - idealization all routers identical network “flat” … not true in practice Network Analysis: Internetworking 4 - 61 Hierarchical Routing aggregate routers into regions, “autonomous systems” (AS) routers in same AS run same routing protocol “intra-AS” routing protocol routers in different AS can run different intra- AS routing protocol special routers in AS run intra-AS routing protocol with all other routers in AS also responsible for routing to destinations outside AS run inter-AS routing protocol with other gateway routers gateway routers Network Analysis: Internetworking 4 - 62 Intra-AS and Inter-AS routing Gateways: •perform inter-AS routing amongst themselves •perform intra-AS routers with other routers in their AS inter-AS, intra-AS routing in gateway A.c network layer link layer physical layer a b b a aC A B d A.a A.c C.b B.a c b c Network Analysis: Internetworking 4 - 65 RIP (Routing Information Protocol) Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x -- 1 …. …. .... w x y z A C D B Routing information in D Network Analysis: Internetworking 4 - 66 RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if tables changed) link failure info quickly propagates to entire net Network Analysis: Internetworking 4 - 67 RIP Table processing RIP routing tables managed by application-level process called route-d (daemon) advertisements sent in UDP packets, periodically repeated Network Analysis: Internetworking 4 - 70 Address Summarizing Eth/1Eth/0 Wic/0 Wic/0 10.0.10.0/24 10.0.10.10/24 10.0.10.20/24 10.0.20.0/24 10.0.20.10/24 10.0.20.20/24 TABLE BEFORE … 10.0.10.0/24 Wic/0 10.0.20.0/24 Wic/0 … TABLE AFTER … 10.0.20.0/22 Wic/0 … 10.0.21.0/24 10.0.21.20/2410.0.21.10/24 Distribution Router Access Router Address changes Network Analysis: Internetworking 4 - 71 Packet to 10.0.21.20 Arrives at Distribution Router • Apply subnet mask of 11111111.11111111.11111100.00000000 to destination address 00001010.00000000.00010101.00010100 • Obtain 10.0.20.0 • Matches distribution router table entry for Wic/0 • Access router routes properly using 24-bit subnet mask. Network Analysis: Internetworking 4 - 72 OSPF (Open Shortest Path First) “open”: publicly available Uses Link State algorithm LS packet dissemination Topology map at each node Route computation using Dijkstra’s algorithm OSPF advertisement carries one entry per neighbor router Advertisements disseminated to entire AS (via flooding) Network Analysis: Internetworking 4 - 75 Hierarchical OSPF Two-level hierarchy: local area, backbone. Link-state advertisements only in area each node has detailed area topology; only knows direction (shortest path) to nets in other areas. Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. Backbone routers: run OSPF routing limited to backbone. Boundary routers: connect to other ASs. Network Analysis: Internetworking 4 - 76 IGRP (Interior Gateway Routing Protocol) CISCO proprietary; successor of RIP (mid 80s) Distance Vector, like RIP several cost metrics (delay, bandwidth, reliability, load etc) uses TCP to exchange routing updates Loop-free routing via Distributed Updating Alg. (DUAL) based on diffused computation Network Analysis: Internetworking 4 - 77 Inter-AS routing Network Analysis: Internetworking 4 - 80 Internet inter-AS routing: BGP BGP messages exchanged using TCP. BGP messages: OPEN: opens TCP connection to peer and authenticates sender UPDATE: advertises new path (or withdraws old) KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request NOTIFICATION: reports errors in previous msg; also used to close connection Network Analysis: Internetworking 4 - 81 Why different Intra- and Inter-AS routing ? Policy: Inter-AS: admin wants control over how its traffic routed, who routes through its net. Intra-AS: single admin, so no policy decisions needed Scale: hierarchical routing saves table size, reduced update traffic Performance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance Network Analysis: Internetworking 4 - 82 IP over ATM: Two Methods Classical IP over ATM Relies on an ARP server (which every node must be able to find) to resolve IP addresses to ATM addresses. LAN Emulation Relies on servers that provide a broadcast service on what is really a point-to-point network. Network Analysis: Internetworking 4 - 85 LAN Emulation over ATM Recall that the original ARP over Ethernet relied on the use of the Ethernet broadcast to resolve its IP addresses to Mac addresses. A number of computer companies decided that it would ease the transition to ATM if ATM could emulate Ethernet and Token Ring interfaces including the broadcast mechanisms. Network Analysis: Internetworking 4 - 86 Implementing LANE Participating ATM devices must have both ATM addresses and 48 bit MAC adresses. Devices connecting to the ATM network are called Lan emulation clients or LECs. Three servers are required: Lan emulation configuration server (LECS) Lan emulation server (LES) The broadcast and unknown server (BUS) Network Analysis: Internetworking 4 - 87 LANE Configuration Each LE client must be configured with the atm address of the LECS and connect to it when it boots. Client gives its ATM address to the LECS. LECS provides type of LAN emulated, max packet size, ATM address of the LES. One LECS may manage several LANEs. Client registers its ATM and MAC addresses with the LES and LES gives client the ATM address of the BUS. Network Analysis: Internetworking 4 - 90 V4 and V6 Address Comparison IPV4 address: 203.178.141.220 Supports about 4 billion IP addresses Envisioned for computers IPV6 address (128 bits): 2001:0200:0000:4819:0280:adff:fe71:81fc Supports about addresses Cellphones, cars, home appliances Observation: Per Cent of IPV4 address space: • North America – 72% • Europe – 17% • Asia/Pacific – 9% 383.4 10× Network Analysis: Internetworking 4 - 91 IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data Network Analysis: Internetworking 4 - 92 Other Changes from IPv4 Checksum: removed entirely to reduce processing time at each hop Options: allowed, but outside of header, indicated by “Next Header” field ICMPv6: new version of ICMP additional message types, e.g. “Packet Too Big” multicast group management functions Network Analysis: Internetworking 4 - 95 Tunneling IPv6 inside IPv4 where needed Network Analysis: Internetworking 4 - 96 VLANs Defn: VLANs define broadcast domains in a layer 2 network. Legacy networks: broadcast domain boundaries were determined by router interfaces. Layer 2 switches: administrator tells switch how far it can propagate the broadcast. What other ports allowed to receive it? Flood to all ports or a subset? Network Analysis: Internetworking 4 - 97 Broadcast Domains in Legacy Networks