lecture 12
DESCRIPTION
Lecture 12. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012. CS3516: These slides are generated from those made available by the authors of our text. BONUS: Useful commands 4.4 IP: Internet Protocol datagram format - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/1.jpg)
Introduction 1-1
Lecture 12
Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith RossAddison-WesleyMarch 2012
CS3516:
These slides are generated from those made available by the authors of our text.
![Page 2: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/2.jpg)
Network Layer 4-2
BONUS: Useful commands4.4 IP: Internet Protocol
datagram format IPv4 addressing ICMP IPv6
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
Lecture 12: outline
![Page 3: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/3.jpg)
Network Layer 4-3
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:\Users\jb>getmacPhysical Address Transport Name============ =============================60-36-DD-AA-13-69 Media disconnected60-36-DD-AA-13-65 \Device\Tcpip_{437F350E-DFD7-4A86-B063-0B9650BD4404}60-36-DD-AA-13-66 Media disconnected60-36-DD-AA-13-66 Media disconnectedB8-CA-3A-DC-C6-2B Media disconnected08-00-27-00-E4-38 \Device\Tcpip_{F551D578-DC71-4760-B91C-B349EAE4238F}
Useful Commands
![Page 4: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/4.jpg)
Network Layer 4-4
IP Configuration Utility (Ipconfig.exe) Displays all current (TCP/IP) network configurations.
C:\Users\jb>ipconfig
Windows IP ConfigurationEthernet adapter Local Area Connection:
Connection-specific DNS Suffix . : WPI.EDU Link-local IPv6 Address . . . . . : fe80::e591:74d4:a495:7998%16 IPv4 Address. . . . . . . . . . . : 130.215.28.36 Subnet Mask . . . . . . . . . . . : 255.255.248.0 Default Gateway . . . . . . . . . : 130.215.24.1
C:\Users\jb>ipconfig /? Prints command line options
C:\Users\jb>ipconfig /displaydns gives dns info cached on nodecs.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
Useful Commands
![Page 5: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/5.jpg)
Network Layer 4-5
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:\Users\jb>nslookup www.google.comServer: a.resolvers.level3.net this is the name of the default serverAddress: 4.2.2.1
Non-authoritative answer:Name: www.google.comAddresses: 2607:f8b0:4000:804::1011 74.125.227.179 74.125.227.180 74.125.227.176 74.125.227.177 74.125.227.178
Useful Commands
![Page 6: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/6.jpg)
Network Layer 4-6
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:\Users\jb>net helpThe syntax of this command is:
Commands available are:
NET ACCOUNTS NET HELPMSG NET STATISTICS NET COMPUTER NET LOCALGROUP NET STOP NET CONFIG NET PAUSE NET TIME NET CONTINUE NET SESSION NET USE NET FILE NET SHARE NET USER NET GROUP NET START NET VIEW NET HELP
NET HELP NAMES explains different types of names in NET HELP syntax lines.
NET HELP SERVICES lists some of the services you can start. NET HELP SYNTAX explains how to read NET HELP syntax lines. NET HELP command | MORE displays Help one screen at a time.
Useful Commands
![Page 7: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/7.jpg)
Network Layer 4-7
Netstat (Netstat.exe) Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, and IPv4/IPv6 statistics.
C:\Users\jb>netstat
Proto Local Address Foreign Address State TCP 127.0.0.1:1029 jb-laptop:5354 ESTABLISHED TCP 127.0.0.1:1036 jb-laptop:27015 ESTABLISHED TCP 127.0.0.1:1047 jb-laptop:19872 ESTABLISHED TCP 127.0.0.1:39055 jb-laptop:39054 ESTABLISHED TCP 172.17.168.138:2492 blugro5relay:2492 ESTABLISHED
C:\Users\jb>netstat -sIPv4 Statistics Packets Received = 10158258 Received Header Errors = 2848 Received Address Errors = 2192434 Datagrams Forwarded = 0 Unknown Protocols Received = 170614 Received Packets Discarded = 4173788 Received Packets Delivered = 6692404
Useful Commands
![Page 8: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/8.jpg)
Network Layer 4-8
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:\Users\jb>route printInterface List13...60 36 dd aa 13 65 ......Intel(R) Centrino(R) Wireless-N 223012...60 36 dd aa 13 69 ......Bluetooth Device (Personal Area Network)31...08 00 27 00 e4 38 ......VirtualBox Host-Only Ethernet Adapter
IPv4 Route TableNetwork Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 172.17.1.1 172.17.168.138 25 127.0.0.0 255.0.0.0 On-link 127.0.0.1 306 127.0.0.1 255.255.255.255 On-link 127.0.0.1 306 127.255.255.255 255.255.255.255 On-link 127.0.0.1 306 169.254.0.0 255.255.0.0 On-link 169.254.40.182 276 169.254.40.182 255.255.255.255 On-link 169.254.40.182 276 169.254.255.255 255.255.255.255 On-link 169.254.40.182 276 172.17.0.0 255.255.0.0 On-link 172.17.168.138 281 172.17.168.138 255.255.255.255 On-link 172.17.168.138 281 172.17.255.255 255.255.255.255 On-link 172.17.168.138 281 224.0.0.0 240.0.0.0 On-link 169.254.40.182 276
Useful Commands
![Page 9: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/9.jpg)
Network Layer 4-9
(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:\Users\jb>arp -a
Interface: 130.215.28.36 --- 0x10 Internet Address Physical Address Type 130.215.24.1 00-00-5e-00-01-01 dynamic 130.215.24.2 00-23-9c-94-97-f0 dynamic 130.215.27.252 f0-1f-af-2f-e1-27 dynamic 130.215.28.63 00-16-3e-c5-01-25 dynamic 130.215.29.165 00-24-e8-32-32-1d dynamic 130.215.31.255 ff-ff-ff-ff-ff-ff static
Useful Commands
![Page 10: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/10.jpg)
Network Layer 4-10
BONUS: Useful commands4.4 IP: Internet Protocol
datagram format IPv4 addressing ICMP IPv6
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
Lecture 12: outline
![Page 11: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/11.jpg)
Network Layer 4-11
IP addressing: CIDR
CIDR: Classless InterDomain Routing subnet portion of address of arbitrary
length address format: a.b.c.d/x, where x is #
bits in subnet portion of address
11001000 00010111 00010000 00000000
subnetpart
hostpart
200.23.16.0/23
![Page 12: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/12.jpg)
Network Layer 4-12
IP addresses: how to get one?Q: How does a host get IP address?
hard-coded by system admin in a file Windows: control-panel->network-
>configuration->tcp/ip->properties UNIX: /etc/rc.config
DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play”
![Page 13: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/13.jpg)
Network Layer 4-13
DHCP: Dynamic Host Configuration Protocolgoal: 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.
![Page 14: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/14.jpg)
Network Layer 4-14
NAT: network address translation
192.168.0.1
192.168.0.2
192.168.0.3
192.168.0.4
138.76.29.7
local network(e.g., home network)
192.168/16rest of
Internet
datagrams with source or destination in this networkhave 192.168/16 address for source, destination (as usual)
all datagrams leaving local
network have same single source NAT IP
address: 138.76.29.7,different source port numbers
![Page 15: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/15.jpg)
Network Layer 4-15
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)
NAT: network address translation
![Page 16: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/16.jpg)
Network Layer 4-16
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
NAT: network address translation
![Page 17: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/17.jpg)
Network Layer 4-17
NAT traversal problem 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
solution1: statically configure NAT to forward incoming connection requests at given port to server e.g., (123.76.29.7, port 2500)
always forwarded to 192.168.0.1 port 25000
192.168.0.1
192.168.0.4
NAT router
138.76.29.7
client?
![Page 18: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/18.jpg)
Network Layer 4-18
NAT traversal problem solution 2: relaying (used in Skype)
NATed client establishes connection to relay external client connects to relay relay bridges packets between to
connections
138.76.29.7client
1. connection torelay initiatedby NATed host
2. connection torelay initiatedby client
3. relaying established
NAT router
192.168.0.1
![Page 19: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/19.jpg)
Network Layer 4-19
4.4 IP: Internet Protocol datagram format IPv4 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
Lecture 12: outline
![Page 20: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/20.jpg)
Network Layer 4-20
Hierarchical routing
scale: with 600 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
![Page 21: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/21.jpg)
Network Layer 4-21
3b
1d
3a
1c2aAS3
AS1AS21a
2c2b
1b
Intra-ASRouting algorithm
Inter-ASRouting algorithm
Forwardingtable
3c
Interconnected ASes
forwarding table configured by both intra- and inter-AS routing algorithm intra-AS sets
entries for internal dests
inter-AS & intra-AS sets entries for external dests
![Page 22: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/22.jpg)
Network Layer 4-22
Inter-AS tasks suppose router in
AS1 receives datagram destined outside of AS1: router should
forward packet to gateway router, but which one?
AS1 must:1. learn which dests
are reachable through AS2, which through AS3
2. propagate this reachability info to all routers in AS1
job of inter-AS routing!
AS3
AS2
3b
3c
3a
AS1
1c1a
1d1b
2a2c
2b
othernetworks
othernetworks
![Page 23: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/23.jpg)
Network Layer 4-23
Example: setting forwarding table in router 1d
suppose AS1 learns (via inter-AS protocol) that subnet x reachable via AS3 (gateway 1c), but not via AS2 inter-AS protocol propagates reachability info to all
internal routers router 1d determines from intra-AS routing info that its
interface I is on the least cost path to 1c installs forwarding table entry (x,I)
AS3
AS2
3b
3c
3a
AS1
1c1a
1d1b
2a2c
2b
othernetworks
othernetworks
x…
![Page 24: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/24.jpg)
Network Layer 4-24
4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6
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
Lecture 12: outline
![Page 25: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/25.jpg)
Network Layer 4-25
Intra-AS Routing
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)
![Page 26: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/26.jpg)
Network Layer 4-26
RIP ( Routing Information Protocol)
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)
DC
BAu v
w
x
yz
subnet hops u 1 v 2 w 2 x 3 y 3 z 2
from router A to destination subnets:
![Page 27: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/27.jpg)
Network Layer 4-27
RIP: example
destination subnet next router # hops to dest
w A 2y B 2
z B 7x -- 1…. …. ....
routing table in router D
w x yz
A
C
D B
![Page 28: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/28.jpg)
Network Layer 4-28
w x yz
A
C
D B
destination subnet next router # hops to dest
w A 2y B 2
z B 7x -- 1…. …. ....
routing table in router D
A 5
dest next hops w - 1 x - 1 z C 4 …. … ...
A-to-D advertisement
RIP: example
![Page 29: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/29.jpg)
Network Layer 4-29
RIP table processing 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
physical
link
network forwarding (IP) table
transport (UDP)
routed
physical
link
network (IP)
transprt (UDP)
routed
forwardingtable
![Page 30: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/30.jpg)
Network Layer 4-30
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
advertisements flooded to entire AS carried in OSPF messages directly over IP
(rather than TCP or UDP AS-AS routing protocol: nearly identical to
OSPF security: all OSPF messages authenticated
(to prevent malicious intrusion) multiple same-cost paths allowed (only
one path in RIP)
![Page 31: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/31.jpg)
Network Layer 4-31
Hierarchical OSPF
boundary routerbackbone router
area 1area 2
area 3
backbone
areaborderrouters
internalrouters
![Page 32: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/32.jpg)
Network Layer 4-32
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.
Hierarchical OSPF
![Page 33: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/33.jpg)
Network Layer 4-33
Internet inter-AS routing: BGP BGP (Border Gateway Protocol): the de
facto inter-domain routing protocol “glue that holds the Internet together”
BGP provides each AS a means to: eBGP: obtain subnet reachability
information from neighboring ASs. iBGP: propagate reachability information to
all AS-internal routers. determine “good” routes to other networks
based on reachability information and policy.
allows subnet to advertise its existence to rest of Internet: “I am here”
![Page 34: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/34.jpg)
Network Layer 4-34
BGP basics
when AS3 advertises a prefix to AS1: AS3 promises it will forward datagrams towards that prefix AS3 can aggregate prefixes in its advertisement
AS3
AS2
3b
3c
3a
AS1
1c1a
1d1b
2a2c
2b
othernetworks
othernetworks
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
BGP message
![Page 35: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/35.jpg)
Network Layer 4-35
BGP basics: distributing path information
AS3
AS2
3b3a
AS1
1c1a
1d1b
2a2c
2b
othernetworks
othernetworks
using eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. 1c can then use iBGP do distribute new prefix info to
all routers in AS1 1b can then re-advertise new reachability info to AS2
over 1b-to-2a eBGP session when router learns of new prefix, it creates
entry for prefix in its forwarding table.
eBGP session
iBGP session
![Page 36: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/36.jpg)
Network Layer 4-36
4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6
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
Lecture 12: outline
![Page 37: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/37.jpg)
Network Layer 4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreation/transmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient:
source duplication: how does source determine recipient addresses?
![Page 38: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/38.jpg)
Network Layer 4-38
In-network duplication
flooding: when node receives broadcast packet, sends copy to all neighbors problems: cycles & broadcast storm
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
spanning tree: no redundant packets received by any node
![Page 39: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/39.jpg)
Network Layer 4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forward/make copies only
along spanning tree
![Page 40: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/40.jpg)
Network Layer 4-40
A
B
G
DE
c
F1
2
3
4
5
(a) stepwise construction of spanning tree (center: E)
A
B
G
DE
c
F
(b) constructed spanning tree
Spanning tree: creation center node each node sends unicast join message
to center node message forwarded until it arrives at a node
already belonging to spanning tree
![Page 41: Lecture 12](https://reader035.vdocument.in/reader035/viewer/2022081603/56815b3f550346895dc91b76/html5/thumbnails/41.jpg)
The End is Near!