Академический Документы
Профессиональный Документы
Культура Документы
Textbook Ch 3.2
Instructor: Joe McCarthy
(based on Prof. Fukudas slides)
You
are
here
CSS432: Internetworking
Protocol Stack
IP on all nodes (both hosts and router)
TCP and UDP on top of IP
H1
TCP
R1
IP
IP
ETH
H8
Identical packet
ETH
Identical frame
R2
Identical
datagram
FDDI
FDDI
IP
R3
Identical
datagram
PPP
PPP
IP
TCP
IP
ETH
ETH
Identical frame
CSS432: Basic Internetworking
Service Model
Global addressing
Connectionless (datagram-based)
Packets may be lost, reordered, duplicated, delayed
Lowest common denominator: run over anything
Simplifies routing (& routers)
IP Packet format:
Ex. Ethernet preamble
dest addr
src addr
0x0800
CRC
4
Version
8
HLen
frame type
Version: IPv4/IPv6
HLen: header length in 32-bit words
http://bpastudio.csudh.edu/fac/lpress/471/hout/netech/stackinaction.htm
16
TOS
31
Length
Ident
TTL
19
Flags
Protocol
Offset
Checksum
SourceAddr
DestinationAddr
Options (variable)
Pad
(variable)
Data
netstat i
[/sbin/]ifconfig
Strategy
netstat i
[/sbin/]ifconfig
Strategy
Fragmentation Example
Send a 1400 byte segment from H5 to H8
MTUs:
802.11:
Ethernet:
PPP: 532 bytes
CSS432: Basic Internetworking
Fragmentation Example
Send a 1400 byte segment from H5 to H8
MTUs:
802.11: 1500 bytes
Ethernet: 1500 bytes
PPP: 532 bytes
CSS432: Basic Internetworking
Fragmentation Example
Send a 1400 byte segment from H5 to H8
376
(a)
376
(b)
MTUs:
802.11: 1500 bytes
Ethernet: 1500 bytes
PPP: 532 bytes
CSS432: Basic Internetworking
Fragmentation Example
Send a 1400 byte segment from H5 to H8
376
(a)
376
(b)
MTUs:
802.11: 1500 bytes
Ethernet: 1500 bytes
PPP: 532 bytes
CSS432: Basic Internetworking
10
Global Addresses
Properties
globally
unique
hierarchical: network + host
Class A
1.0.0.1 126.255.255.254
Class B
128.0.0.1 191.255.255.254
Class C
192.0.0.1 223.255.255.254
A:
B:
C:
24
Network
Host
1 0
1 1 0
14
16
Network
Host
21
Network
Host
11
Datagram Forwarding
Algorithm
If ( datagrams dest network # == network # of network interface x )
deliver it to the destination host over interface x
else if ( datagrams dest network # == network # of a next hop router y )
deliver it to the router y
else
deliver it to its default router
Example
12
Eth2: 172.16.5.1
Router 2
Eth0: 172.16.1.2
172.16.3.0/24
Eth1: 172.16.3.1
Eth0: 172.16.3.2
Router 3
Eth1: 172.16.4.1
172.16.2.0/24
Eth1: 172.16.2.1
Router 1
hostname router1
Eht0: 172.16.1.1
!
interface ethernet 0
ip address 172.16.1.1 255.255.255.0
!
interface ethernet 1
ip address 172.16.2.1 255.255.255.0
!
ip route 172.16.3.0 255.255.255.0 172.16.1.2
ip route 172.16.4.0 255.255.255.0 172.16.1.2
ip route 172.16.5.0 255.255.255.0 172.16.1.2
CSS432: Basic Internetworking
172.16.4.0/24
172.16.1.0/24
13
Address Translation
destination host
next hop router
Techniques
Problems
table-based
14
CSS432: Internetworking
15
ARP Details
Request (from A): Im IPa and Pha. Youre IPb. How about Phb?
IP
Ph
IP
Ph
IPa
Pha
IPb
Phb
IPb
??
Response (from B): Im IPb and Phb. Youre IPa and Pha
IP
Ph
IP
Ph
IPa
Pha
IPb
Phb
IPb
Phb
IPa
Pha
16
Ex. Ethernet
preamble
dest addr
src addr
0x0806
CRC
17
IP
Ph
??
Pha
RARP server
IP
Ph
IPa
Pha
IPb
Phb
IP
Ph
IPa
Pha
RARP server
IP
Ph
IPa
Pha
IPb
Phb
18
Other network
Unicast
Frame addr
DHCP
server
datagram
UDP header
Client:
BOOTP/DHCP
OP
Htype
HLEN HOPS
Xid
Secs
Flags
Client IP addr
Your IP addr
Server IP addr
Router IP aaddr
Client Hardware addr
Server host name
Boot file name
Options
19
INITIALIZE
Receive DHCPOFFER
from all servers
DHCPNACK
Or
Lease expires
REBIND
DHCPNACK
RENEW
DHCPACK
DHCPACK
REQUEST
20
Diskless Workstation
Step 1B:
BOOTP reply: Server = mercury, BOOT FILE NAME=/local/var/bootfiles/xncd19r
File server
Step 2B: TFTP reply: image returned
OS Image:
Unix
Windows
CSS432: Internetworking
21
http://www.borella.net/content/MITP432/ICMP/img4.html
CSS432: Internetworking
22
0 and 8
Echo reply/request
Destination unreachable
11
TTL exceeded
11
Applications
ping
Trace route,
23
http://nmap.org/book/tcpip-ref.html
CSS432: Internetworking
24
R1
R2
R3
RK
Rcv
ICMP data
ICMP
IP
datagram heaader
Data Link
frame header
CSS432: Internetworking
25
Reviews
IP
Exercises in Chapter 3
Ex.
36 (fragmentation)
Ex. 44 (ARP)
Ex. 45 (ARP)
CSS432: Basic Internetworking
26
Ex 36
36. Suppose a TCP message that contains 1024 bytes of data
and 20 bytes of TCP header is passed to IP for delivery across
two networks interconnected by a router (i.e., it travels from
the source host to a router to the destination host).
The first network has an MTU of 1024 bytes; the second has a MTU of 576 bytes.
Each networks MTU gives the size of the largest IP datagram
that can be carried in a link-layer frame.
Give the sizes and offsets of the sequence of fragments delivered to the network
layer at the destination host. Assume all IP headers are 20 bytes.
CSS432: Internetworking
27
Ex 44
44. Suppose hosts A and B have been assigned the same IP address
on the same Ethernet, on which ARP is used. B starts up after A.
What will happen to As existing connections?
Explain how self-ARP (querying the network on start-up
for ones own IP address) might help with this problem.
CSS432: Internetworking
28
Ex 45
45. Suppose an IP implementation adheres literally to the following algorithm
on receipt of a packet, P, destined for IP address D:
if ( Ethernet address for D is in ARP cache )
send P
else
send out an ARP Query for D
put P into a queue until the response comes back
(a) If the IP layer receives a burst of packets destined for D,
how might this algorithm waste resources unnecessarily?
(b) Sketch an improved version.
(c) Suppose we simply drop P, after sending out a query,
when cache lookup fails. How would this behave?
(Some early ARP implementations allegedly did this)
CSS432: Internetworking
29
Q2.
(DHCP)
(DHCP)
CSS432: Internetworking
30