Lecture 12 CS 3516 These slides are generated

  • Slides: 41
Download presentation
Lecture 12 CS 3516: These slides are generated from those made available by the

Lecture 12 CS 3516: These slides are generated from those made available by the authors of our text. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Introduction 1 -1

Lecture 12: outline BONUS: Useful commands 4. 4 IP: Internet Protocol § § datagram

Lecture 12: outline BONUS: Useful commands 4. 4 IP: Internet Protocol § § datagram format IPv 4 addressing ICMP IPv 6 4. 5 routing algorithms § link state § distance vector § hierarchical routing 4. 6 routing in the Internet § RIP § OSPF § BGP 4. 7 broadcast and multicast routing Network Layer 4 -2

Useful Commands Get MAC Address (Getmac. exe) Discovers the Media Access Control (MAC) address

Useful Commands Get MAC Address (Getmac. exe) Discovers the Media Access Control (MAC) address and lists associated network protocols for all network cards in a computer, either locally or across a network. C: Usersjb>getmac Physical Address Transport Name ===================== 60 -36 -DD-AA-13 -69 Media disconnected 60 -36 -DD-AA-13 -65 DeviceTcpip_{437 F 350 E-DFD 7 -4 A 86 -B 063 -0 B 9650 BD 4404} 60 -36 -DD-AA-13 -66 Media disconnected B 8 -CA-3 A-DC-C 6 -2 B Media disconnected 08 -00 -27 -00 -E 4 -38 DeviceTcpip_{F 551 D 578 -DC 71 -4760 -B 91 C-B 349 EAE 4238 F} Network Layer 4 -3

Useful Commands IP Configuration Utility (Ipconfig. exe) Displays all current (TCP/IP) network configurations. C:

Useful Commands IP Configuration Utility (Ipconfig. exe) Displays all current (TCP/IP) network configurations. C: Usersjb>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Link-local IPv 6 Address IPv 4 Address. . . Subnet Mask. . . Default Gateway. . C: Usersjb>ipconfig /? Suffix. . . . . : : : WPI. EDU fe 80: : e 591: 74 d 4: a 495: 7998%16 130. 215. 28. 36 255. 248. 0 130. 215. 24. 1 Prints command line options C: Usersjb>ipconfig /displaydns gives dns info cached on node cs. wpi. edu --------------------Record Name. . . : cs. wpi. edu Record Type. . . : 1 Time To Live. . : 73497 Data Length. . . : 4 Section. . . . : Answer A (Host) Record. . . : 130. 215. 28. 181 Network Layer 4 -4

Useful Commands Name Server Lookup (Nslookup. exe) Displays information about Domain Name System records

Useful Commands Name Server Lookup (Nslookup. exe) Displays information about Domain Name System records for specific IP addresses and/or host names so that you can troubleshoot DNS problems. C: Usersjb>nslookup www. google. com Server: a. resolvers. level 3. net this is the name of the default server Address: 4. 2. 2. 1 Non-authoritative answer: Name: www. google. com Addresses: 2607: f 8 b 0: 4000: 804: : 1011 74. 125. 227. 179 74. 125. 227. 180 74. 125. 227. 176 74. 125. 227. 177 74. 125. 227. 178 Network Layer 4 -5

Useful Commands Net services commands (Net. exe) Performs a broad range of network tasks.

Useful Commands Net services commands (Net. exe) Performs a broad range of network tasks. Type net with no parameters to see a full list of available command-line options. C: Usersjb>net help The syntax of this command is: Commands available are: NET NET ACCOUNTS COMPUTER CONFIG CONTINUE FILE GROUP HELP NET NET HELP NET NET NET HELPMSG LOCALGROUP PAUSE SESSION SHARE START NET NET NET STATISTICS STOP TIME USER VIEW NAMES explains different types of names in NET HELP syntax lines. SERVICES lists some of the services you can start. SYNTAX explains how to read NET HELP syntax lines. command | MORE displays Help one screen at a time. Network Layer 4 -6

Useful Commands Netstat (Netstat. exe) Displays active TCP connections, ports on which the computer

Useful Commands Netstat (Netstat. exe) Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, and IPv 4/IPv 6 statistics. C: Usersjb>netstat Proto TCP TCP TCP Local Address 127. 0. 0. 1: 1029 127. 0. 0. 1: 1036 127. 0. 0. 1: 1047 127. 0. 0. 1: 39055 172. 17. 168. 138: 2492 C: Usersjb>netstat -s IPv 4 Statistics Packets Received Header Errors Received Address Errors Datagrams Forwarded Unknown Protocols Received Packets Discarded Received Packets Delivered Foreign Address jb-laptop: 5354 jb-laptop: 27015 jb-laptop: 19872 jb-laptop: 39054 blugro 5 relay: 2492 = = = = State ESTABLISHED ESTABLISHED 10158258 2848 2192434 0 170614 4173788 6692404 Network Layer 4 -7

Useful Commands Network Command Shell (Netsh. exe) Displays or modifies the network configuration of

Useful Commands Network Command Shell (Netsh. exe) Displays or modifies the network configuration of a local or remote computer that is currently running. This command-line scripting utility has a huge number of options, which are fully detailed in Help. TCP/IP Route (Route. exe) Displays and modifies entries in the local IP routing table. C: Usersjb>route print Interface List 13. . . 60 36 dd aa 13 65. . . Intel(R) Centrino(R) Wireless-N 2230 12. . . 60 36 dd aa 13 69. . . Bluetooth Device (Personal Area Network) 31. . . 08 00 27 00 e 4 38. . . Virtual. Box Host-Only Ethernet Adapter IPv 4 Route Table Network Destination Netmask 0. 0 127. 0. 0. 0 255. 0. 0. 0 127. 0. 0. 1 255 127. 255 169. 254. 0. 0 255. 0. 0 169. 254. 40. 182 255 169. 254. 255 255 172. 17. 0. 0 255. 0. 0 172. 17. 168. 138 255 172. 17. 255 255 224. 0. 0. 0 240. 0 Gateway 172. 17. 1. 1 On-link On-link On-link Interface Metric 172. 17. 168. 138 25 127. 0. 0. 1 306 169. 254. 40. 182 276 172. 17. 168. 138 281 169. 254. 40. 182 276 Network Layer 4 -8

Useful Commands (Arp. exe) Displays current ARP entries by interrogating the current protocol data.

Useful Commands (Arp. exe) Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed. C: Usersjb>arp -a Interface: 130. 215. 28. 36 --- 0 x 10 Internet Address Physical Address 130. 215. 24. 1 00 -00 -5 e-00 -01 -01 130. 215. 24. 2 00 -23 -9 c-94 -97 -f 0 130. 215. 27. 252 f 0 -1 f-af-2 f-e 1 -27 130. 215. 28. 63 00 -16 -3 e-c 5 -01 -25 130. 215. 29. 165 00 -24 -e 8 -32 -32 -1 d 130. 215. 31. 255 ff-ff-ff-ff Type dynamic dynamic static Network Layer 4 -9

Lecture 12: outline BONUS: Useful commands 4. 4 IP: Internet Protocol § § datagram

Lecture 12: outline BONUS: Useful commands 4. 4 IP: Internet Protocol § § datagram format IPv 4 addressing ICMP IPv 6 4. 5 routing algorithms § link state § distance vector § hierarchical routing 4. 6 routing in the Internet § RIP § OSPF § BGP 4. 7 broadcast and multicast routing Network Layer 4 -10

IP addressing: CIDR: Classless Inter. Domain Routing § subnet portion of address of arbitrary

IP addressing: CIDR: Classless Inter. Domain Routing § subnet portion of address of arbitrary length § address format: a. b. c. d/x, where x is # bits in subnet portion of address host subnet part 11001000 00010111 00010000 200. 23. 16. 0/23 Network Layer 4 -11

IP addresses: how to get one? Q: How does a host get IP address?

IP addresses: how to get one? Q: How does a host get IP address? v hard-coded by system admin in a file § Windows: control-panel->network->configuration>tcp/ip->properties § UNIX: /etc/rc. config v DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server § “plug-and-play” Network Layer 4 -12

DHCP: Dynamic Host Configuration Protocol goal: allow host to dynamically obtain its IP address

DHCP: Dynamic Host Configuration Protocol goal: allow host to dynamically obtain its 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 want to join network (more shortly) 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) You don’t get any old IP address – it has to be one that can be services by the port on the router you’re connected to. Network Layer 4 -13

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) 192. 168/16 192. 168. 0. 1 192. 168. 0. 4 192. 168. 0. 2 138. 76. 29. 7 192. 168. 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 192. 168/16 address for source, destination (as usual) Network Layer 4 -14

NAT: network address translation motivation: local network uses just one IP address as far

NAT: network address translation motivation: local network uses just one IP address as far as outside world is concerned: § range of addresses not needed from ISP: just one IP address 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) Network Layer 4 -15

NAT: network address translation implementation: NAT router must: § outgoing datagrams: replace (source IP

NAT: network address translation implementation: NAT router must: § 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 § 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 dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Network Layer 4 -16

NAT traversal problem v client wants to connect to server with address 192. 168.

NAT traversal problem v client wants to connect to server with address 192. 168. 0. 1 § server address 192. 168. 0. 1 local to LAN (client can’t use it as destination addr) § only one externally visible NATed address: 138. 76. 29. 7 v solution 1: statically configure NAT to forward incoming connection requests at given port to server 192. 168. 0. 1 client ? 192. 168. 0. 4 138. 76. 29. 7 NAT router § e. g. , (123. 76. 29. 7, port 2500) always forwarded to 192. 168. 0. 1 port 25000 Network Layer 4 -17

NAT traversal problem v solution 2: relaying (used in Skype) § NATed client establishes

NAT traversal problem v solution 2: relaying (used in Skype) § NATed client establishes connection to relay § external client connects to relay § relay bridges packets between to connections 2. connection to relay initiated by client 3. relaying established 1. connection to relay initiated by NATed host 138. 76. 29. 7 192. 168. 0. 1 NAT router Network Layer 4 -18

Lecture 12: outline 4. 4 IP: Internet Protocol § datagram format § IPv 4

Lecture 12: outline 4. 4 IP: Internet Protocol § datagram format § IPv 4 addressing § ICMP 4. 5 routing algorithms § link state § distance vector § hierarchical routing 4. 6 routing in the Internet § RIP § OSPF § BGP 4. 7 broadcast and multicast routing Network Layer 4 -19

Hierarchical routing our routing study thus far - idealization v all routers identical v

Hierarchical routing our routing study thus far - idealization v all routers identical v network “flat” … not true in practice scale: with 600 million destinations: v v can’t store all dest’s in routing tables! routing table exchange would swamp links! administrative autonomy v v internet = network of networks each network admin may want to control routing in its own network Network Layer 4 -20

Interconnected ASes 3 c 3 a 3 b AS 3 2 a 1 c

Interconnected ASes 3 c 3 a 3 b AS 3 2 a 1 c 1 a 1 d 1 b AS 1 Intra-AS Routing algorithm Inter-AS Routing algorithm Forwarding table 2 c 2 b AS 2 v forwarding table configured by both intraand inter-AS routing algorithm § intra-AS sets entries for internal dests § inter-AS & intra-AS sets entries for external dests Network Layer 4 -21

Inter-AS tasks v suppose router in AS 1 receives datagram destined outside of AS

Inter-AS tasks v suppose router in AS 1 receives datagram destined outside of AS 1: § router should forward packet to gateway router, but which one? AS 1 must: 1. learn which dests are reachable through AS 2, which through AS 3 2. propagate this reachability info to all routers in AS 1 job of inter-AS routing! 3 c 3 b other networks 3 a AS 3 1 c 1 a AS 1 1 d 2 a 1 b 2 c 2 b other networks AS 2 Network Layer 4 -22

Example: setting forwarding table in router 1 d v v suppose AS 1 learns

Example: setting forwarding table in router 1 d v v suppose AS 1 learns (via inter-AS protocol) that subnet x reachable via AS 3 (gateway 1 c), but not via AS 2 § inter-AS protocol propagates reachability info to all internal routers router 1 d determines from intra-AS routing info that its interface I is on the least cost path to 1 c § installs forwarding table entry (x, I) … 3 c 3 b other networks x 3 a AS 3 1 c 1 a AS 1 1 d 2 a 1 b 2 c 2 b other networks AS 2 Network Layer 4 -23

Lecture 12: outline 4. 4 IP: Internet Protocol § § datagram format IPv 4

Lecture 12: outline 4. 4 IP: Internet Protocol § § datagram format IPv 4 addressing ICMP IPv 6 4. 5 routing algorithms § link state § distance vector § hierarchical routing 4. 6 routing in the Internet § RIP § OSPF § BGP 4. 7 broadcast and multicast routing Network Layer 4 -24

Intra-AS Routing v v also known as interior gateway protocols (IGP) most common intra-AS

Intra-AS Routing v v also known as interior gateway protocols (IGP) most common intra-AS routing protocols: § RIP: Routing Information Protocol § OSPF: Open Shortest Path First § IGRP: Interior Gateway Routing Protocol (Cisco proprietary) Network Layer 4 -25

RIP ( Routing Information Protocol) v v included in BSD-UNIX distribution in 1982 distance

RIP ( Routing Information Protocol) v v included in BSD-UNIX distribution in 1982 distance vector algorithm § distance metric: # hops (max = 15 hops), each link has cost 1 § DVs exchanged with neighbors every 30 sec in response message (aka advertisement) § each advertisement: list of up to 25 destination subnets (in IP addressing sense) from router A to destination subnets: u v A B w z C D x y subnet u v w x y z hops 1 2 2 3 3 2 Network Layer 4 -26

RIP: example z w A x y B D C routing table in router

RIP: example z w A x y B D C routing table in router D destination subnet next router # hops to dest w y z x A B B -- 2 2 7 1 …. . . Network Layer 4 -27

RIP: example dest w x z …. w A A-to-D advertisement next hops 1

RIP: example dest w x z …. w A A-to-D advertisement next hops 1 1 C 4 …. . . x z y B D C routing table in router D destination subnet next router # hops to dest w y z x A B -- 2 2 5 7 1 …. . . Network Layer 4 -28

RIP table processing v v v RIP routing tables managed by application-level process called

RIP table processing v v v RIP routing tables managed by application-level process called route-d (daemon) advertisements sent in UDP packets, periodically repeated if no advertisement heard after 180 sec --> neighbor/link declared dead § routes via neighbor invalidated § new advertisements sent to neighbors routed transport (UDP) network forwarding (IP) table link physical forwarding table transprt (UDP) network (IP) link physical Network Layer 4 -29

OSPF (Open Shortest Path First) v v “open”: publicly available uses link state algorithm

OSPF (Open Shortest Path First) v v “open”: publicly available uses link state algorithm § LS packet dissemination § topology map at each node § route computation using Dijkstra’s algorithm v v OSPF advertisement carries one entry per neighbor advertisements flooded to entire AS § carried in OSPF messages directly over IP (rather than TCP or UDP v v v AS-AS routing protocol: nearly identical to OSPF security: all OSPF messages authenticated (to prevent malicious intrusion) multiple same-cost paths allowed (only one. Network path Layer 4 -30

Hierarchical OSPF boundary router backbone area border routers area 3 internal routers area 1

Hierarchical OSPF boundary router backbone area border routers area 3 internal routers area 1 area 2 Network Layer 4 -31

Hierarchical OSPF v v two-level hierarchy: local area, backbone. § link-state advertisements only in

Hierarchical OSPF v v two-level hierarchy: local area, backbone. § link-state advertisements only in area § each nodes has detailed area topology; only know 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 AS’s. Network Layer 4 -32

Internet inter-AS routing: BGP v BGP (Border Gateway Protocol): the de facto inter-domain routing

Internet inter-AS routing: BGP v BGP (Border Gateway Protocol): the de facto inter-domain routing protocol § “glue that holds the Internet together” v BGP provides each AS a means to: § e. BGP: obtain subnet reachability information from neighboring ASs. § i. BGP: propagate reachability information to all AS-internal routers. § determine “good” routes to other networks based on reachability information and policy. v allows subnet to advertise its existence to rest of Internet: “I am here” Network Layer 4 -33

BGP basics v BGP session: two BGP routers (“peers”) exchange BGP messages: § advertising

BGP basics v BGP session: two BGP routers (“peers”) exchange BGP messages: § advertising paths to different destination network prefixes (“path vector” protocol) § exchanged over semi-permanent TCP connections v when AS 3 advertises a prefix to AS 1: § AS 3 promises it will forward datagrams towards that prefix § AS 3 can aggregate prefixes in its advertisement 3 c 3 b other networks 3 a BGP message AS 3 1 c 1 a AS 1 1 d 2 a 1 b 2 c 2 b other networks AS 2 Network Layer 4 -34

BGP basics: distributing path information v using e. BGP session between 3 a and

BGP basics: distributing path information v using e. BGP session between 3 a and 1 c, AS 3 sends prefix reachability info to AS 1. § 1 c can then use i. BGP do distribute new prefix info to all routers in AS 1 § 1 b can then re-advertise new reachability info to AS 2 over 1 b -to-2 a e. BGP session v when router learns of new prefix, it creates entry for prefix in its forwarding table. e. BGP session 3 b other networks 3 a AS 3 i. BGP session 1 c 1 a AS 1 1 d 2 a 1 b 2 c 2 b other networks AS 2 Network Layer 4 -35

Lecture 12: outline 4. 4 IP: Internet Protocol § § datagram format IPv 4

Lecture 12: outline 4. 4 IP: Internet Protocol § § datagram format IPv 4 addressing ICMP IPv 6 4. 5 routing algorithms § link state § distance vector § hierarchical routing 4. 6 routing in the Internet § RIP § OSPF § BGP 4. 7 broadcast and multicast routing Network Layer 4 -36

Broadcast routing v v deliver packets from source to all other nodes source duplication

Broadcast routing v v deliver packets from source to all other nodes source duplication is inefficient: duplicate R 1 duplicate creation/transmission R 1 duplicate R 2 R 3 R 4 source duplication v R 3 R 4 in-network duplication source duplication: how does source determine recipient addresses? Network Layer 4 -37

In-network duplication v flooding: when node receives broadcast packet, sends copy to all neighbors

In-network duplication v flooding: when node receives broadcast packet, sends copy to all neighbors § problems: cycles & broadcast storm v controlled flooding: node only broadcasts pkt if it hasn’t broadcast same packet before § node keeps track of packet ids already broadacsted § or reverse path forwarding (RPF): only forward packet if it arrived on shortest path between node and source v spanning tree: § no redundant packets received by any node Network Layer 4 -38

Spanning tree v v first construct a spanning tree nodes then forward/make copies only

Spanning tree v v first construct a spanning tree nodes then forward/make copies only along spanning tree A A B c D F D E F G (a) broadcast initiated at A E G (b) broadcast initiated at D Network Layer 4 -39

Spanning tree: creation v v center node each node sends unicast join message to

Spanning tree: creation v v center node each node sends unicast join message to center node § message forwarded until it arrives at a node already belonging to spanning tree A A 3 B c 4 F 1 E 2 B c D D F 5 E G (a) stepwise construction of spanning tree (center: E) G (b) constructed spanning tree Network Layer 4 -40

The End is Near!

The End is Near!