IP and Routing - SPARCS
Download
Report
Transcript IP and Routing - SPARCS
IP and Routing
[email protected]
Dep. of CS in KAIST
Overview
Introduction to network
IP - Internet Protocol
IP Routing
Introduction to network I
Four layer of network
Application
Transport
Network
Link
Telnet, FTP, e-mail, etc.
TCP, UDP
IP, ICMP, IGMP
Device driver and interface card
Internet Addresses
class A
class B
class C
class D
class E
0
Netid (7)
1 0
1 1 0
1 1 1 0
1 1 1 1 0
Hostid (24)
Netid (14)
Hostid (16)
Netid (21)
Multicast group ID (28)
(reserved for future use) (27)
Hostid (8)
Introduction to network II
Encapsulation
User data
Appl header
Ethernet header
User data
TCP header
Application data
IP header
TCP header
Application data
IP header
TCP header
Application data
Ethernet tailer
Introduction to network III
Ehternet Encapsulation
Destination
addr
6
MTU
Source
addr
6
Type
data
CRC
2
Type
0800
2
Type
0806
2
Type
8035
2
46-1500
4
IP datagram
46-1500
ARP request/reply
PAD
28
18
RARP request/reply
PAD
28
18
Network
Hyperchannel
16 Mbits/sec token ring (IBM)
4 Mbits/sec token ring (IEEE 802.5)
FDDI
Ethernet
IEEE 802.3/802.2
X.25
Point-topoint (low delay)
MTU (byte)
65535
17914
4464
4352
1500
1492
576
296
IP - Internet Protocol I
Character
–
–
Unreliable
Connectionless
IP header
Header
TOS
Total length
length
identification
flag
Fragment offset
TTL
protocol
Header checksum
Source IP address
Destination IP address
Version
Options (if any)
Data
IP - Internet Protocol II
Header length
–
TTL (Time To Live)
–
number of 32-bit words in the header
sets an upper limit on the number of routers through
which a datagram can pass
TOS (Type of Service) Field
–
–
–
3-bit precedence field (which is ignored today)
4 TOS field
unused bit (that must be 0)
IP - Internet Protocol III
4 TOS Field
Application
Telnet/Rlogin
FTP
Control
Data
Any bulk data
TFTP
SMTP
Command phase
Data phase
DNS
UDP query
TCP query
Zone transfer
ICMP
Error
Query
Any IGP
SNMP
BOOTP
NNTP
Minimize
delay
1
Maximize
throughput
0
Maximize
realiability
0
Minimize
monetary cost
0
Hex
value
0x10
1
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0x10
0x08
0x08
0x10
1
0
0
1
0
0
0
0
0x10
0x08
1
0
0
0
0
1
0
0
0
0
0
0
0x10
0x00
0x08
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
1
0x00
0x00
0x04
0x04
0x00
0x02
IP - Internet Protocol IV
Subnet mask
–
–
–
To know how many bits are for host ID
One bits for the network ID and subnet ID
Zero bits for the host ID
Special Case IP Addresses
Net ID
0
0
127
-1
Netid
Netid
Netid
IP address
Subnet ID
Subnetid
-1
Host ID
0
Hostid
Anything
-1
-1
-1
-1
Can appear as
Source Destination
OK
Never
OK
Never
OK
OK
Never
OK
Never
OK
Never
OK
Never
OK
Description
This host on this net
Specified host on this net
Loopback address
Limited broadcast
Net-directed broadcast to netid
Subnet-directed broadcast to netid, subnetid
All-subnets-directed broadcast to netid
IP Routing I
Routing table
–
–
–
–
destination IP address
next-hop router
Flags
Specification of network interface
Routing Principles
–
–
–
Search for a matching host address
Search for a matching network address
Serch for a default entry
IP Routing II
ICMP (Internet Control Message Protocol)
–
Communicates error messages and other conditions.
IP
Header
ICMP message
20 bytes
8-bit type
8-bit code
16-bit checksum
(contents depends on type and code)
IP Routing III
ICMP Redirect Errors
–
Example of an ICMP redirection
host
(1)IP datagram
(3)ICMP redirect
(2)IP datagram
R1
R2
IP Routing IV
Format of the ICMP redirect message
Type (5)
Code (0-3)
checksum
Router IP address that should be used
IP header (including options) + first 8 bytes of original IP datagram data
Code
0
1
2
3
Description
Redirect for network
Redirect for host
Redirect for type-of-service and network
Redirect for type-of-service and host
IP Routing V
ICMP Router Discovery Messages
–
–
initialize a routing table
concept
broadcast(or
multicast) router solicitation
message
routers respond with a router advertisements
message
Type (10)
Code (0) solicitation
Checksum
Format
of router
message
Unused (sent as 0)
IP Routing VI
Format of router advertisement message
Type (9)
Code (0)
Checksum
Number of
Addresses
Address
Entry size (2)
Lifetime
Router address [1]
Preference level [1]
Router address [2]
Preference level [2]
:
:
References
TCP/IP Illustrated by W. Richard Stevens