No Slide Title
Download
Report
Transcript No Slide Title
CONSYL
IP-Internet Protocol
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 1
CONSYL
Agenda
IP functions
IP header format
Routing architecture
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 2
CONSYL
IP layer
defines a single virtual network on top of different
kinds of hardware platform using IP address
functions of IP
route packet
fragmentation
handle type of services
send and receive error and control message using
ICMP
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 3
CONSYL
IP attributes
handle data unit called IP datagrams
conectionless protocol - doesn抰 promise reliable
delivery
best effort delivery
packets may be lost, out of sequence, or
duplicated due to various reasons
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 4
CONSYL
IP encapsulation
with Ethernet frame
datagrams
ethernet hdr
Department of Computer Engineering, Kasetsart University
ip header
data
204325 Introduction to Computer Communications and Networks
4/11/40 page 5
CONSYL
IP reframing
•IP will reframe the packet when A send data to B
IP
158.108.33.1
MAC 0:0:c:6:13:4a
MAC dest
MAC src
type
IP source
IP dest
IP
158.108.2.1
MAC 0:0:c:6:12:40
0:0:c:6:13:4a
0:0:e8:15:cc:c
0x800
158.108.33.4
158.108.2.71
MAC dest
MAC src
type
IP source
IP dest
packet to router
A
0:0:33:10:a:c
0:0:c:6:12:40
0x800
158.108.33.4
158.108.2.71
packet from router
IP
158.108.33.4
MAC
0:0:e8:15:cc:c
B
IP
158.108.2.71
MAC 0:0:33:10:a:c
Change MAC address, IP address be the same
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 6
CONSYL
IP datagrams
0
15 16
vers:4 hlen:4
31
TOS:8
identification:16
20 time to live:8
bytes
total length:16
flags:3
protocol:8
frag offset:13
header checksum :16
source address :32
destination address :32
options and padding :32
data
:
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 7
CONSYL
IP header details (1)
vers - version = 4
hlen - header length in 32-bit words, hlen =5 with no
options
TOS - type of service, desired quality of services
0
1
2
Prec.
3
4
5
6
7
D
T
R
0
0
bits
if 0
if 1
0-2 Precedence
3
Normal delay
low delay
4
Normal throughput High throughput
5
Normal Reliablity
High reliability
6-7 Reserved
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 8
CONSYL
IP header details (2)
Total length - max datagrams (including header) is 64K
identification, flags, fragmentation - use to
segmentation and reassembly packet
TTL - Time to live, max number of routers through which the
datagrams may pass (hop count)
decrease at each router to prevent looping
normaly set to 30
if ttl == 0 discard and send ICMP TTL exeeded to source IP
Protocol - higher-level protocol that provide data
1 = datagrams carries an ICMP messages
6 = datagrams carries an TCP segments
17 = datagrams carries an UDP datagrams
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 9
CONSYL
IP header details (3)
header checksum - 16 bit one抯 compliment, note
that there is no data checksum
source addres - 32 bit IP source address
destination addres - 32 bit IP destination address
option and padding - additional info to control
functions such as routing and security
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 10
CONSYL
Routing
process of choosing a path over which to send
datagrams
IP routes packet by looking at the IP network number
routing components
determine what path are available
selecting the best path for a particular purpose
using those paths to reach other networks
devices which perform routing are routers (historically
call IP gateways)
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 11
CONSYL
Routing Table
Every router contains a routing table of the network
numbers
The table records
which connection can be used to reach a
particular network
plus some indication of the performance or cost of
using connection
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 12
CONSYL
Routing Table form
Routing Table form
<network, gateways, others>
% netstat -rn
Destination Gateway
127.0.0.1
127.0.0.1
default
158.108.33.1
158.108.33.0 158.108.33.3
Department of Computer Engineering, Kasetsart University
Flags
UH
UG
U
Refcnt Use Interf
4
72705 lo0
14
10265 le0
4
1702 le0
204325 Introduction to Computer Communications and Networks
4/11/40 page 13
CONSYL
How to create routing Table
static route - by hand
% route add 158.108.20.0 158.108.33.1
dynamic routes - via routing protocol
via ICMP redirect
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 14
CONSYL
Routing Protocol
Routing protocol manages and updates routing table
on each network node
Unix often implemented using one of the two
daemons:
routed : basic routing daemon for interior routing, normally
with RIP
gated : sophisticated daemon for interior and exterior
routing, with additional protocol such as OSPF, BGP
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 15
CONSYL
Fragmentation
fragmentation = processed used by IP to reduced size
of datagram that are too big for network interface MTU
e.g. fragment 2000 bytes to Ethernet (MTU=1500)
fragments should be reassembled at the final
destination (expensive process)
How ?
each fragment has its own header
each fragment carries the same 16 bit identification number
Each fragment must be aligned with an eight-octet boundary
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 16
CONSYL
Fragmentation flag
Identification number
16 bits integer value used to identify all fragments
This id is not a sequence number!
flags - 3 bits control fragmentation
0= may fragment
1= don抰 fragment
reserve,
must be 0
R
0= last fragment
1= more fragments
DF
MF
fragment offset - indicate the distance of fragment data
from the start of the original datagram, measure in 8 octets unit
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 17
CONSYL
Fragmentation sample
other header
original
厖.
ident flags offset
232
0
0
0..2000
20 bytes
20 bytes
ethernet
with MTU ... 111 1
of 1500
data
0
0..1479
... 111 0 185 1480..2000
identification number
more fragment
last fragment
post 0
Department of Computer Engineering, Kasetsart University
post 185*8=1480
204325 Introduction to Computer Communications and Networks
4/11/40 page 18
CONSYL
Problem in fragmentation
The end node has no way of knowing how many fragments
there be. The end node has to mangae enough buffer space
to handle reassembly process.
If any fragments lost, all datagram must be discarded
End node starts a timer when received the first fragment, if any
fragments fails to arrive(usually 30 secs), all datagrams
must be discarded
Since the IP service is conectionless. No attempt is made by IP
to recover these situations, though ICMP error message may be
genertaed
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 19
CONSYL
Avoiding fragmentation
For datagrams within the same physical network, the MTU is known.
TCP/UDP then use the MTU to limit the message size pass to IP;
messages will never be fragmented.
For datagrams passed to diff net, no way to know the MTU!
standard recommend that all networks supporting TCP/IP have an
MTU of at least 576 bytes
512 bytes data+20 bytes TCP hdr + 20 bytes IP hdr with options
TO GUARANTEED THAT A PACKET OF 576 BYTES OR LESS IS NEVER
FRAGMENTED
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 20
CONSYL
IPng
Problem of current IP address : limitation of 32 bit
address space
1990 : IETF defined a new version of IP, generally called
IP Next Generation or IPng
Spring 1992 : IAB issues IPv7, proposed the OSI CLNP
(connectionless Network Protocol) as the basis of IPv7.
Finally rejected by IETF and wkrgs
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 21
CONSYL
IPV6
End 1992: seven proposals for IPng
resolution to 3 possiblities :
CNAT, IP Encaps, Nimrod, Simple CLNP, P Internet Protocol, SIP, and
TP/IX
SIP+ TP/IX => TUBA (TCP and UDP with bigger Address: RFC 1347)
TP/IX => CATNIP (Common Architecture for the Next Generation Internet
Protocol :RFC1707)
SIP+IP encaps+PIP=> SIPP (Simple Internet Protocol Plus: RFC1710)
Mid 1994 : SIPP was chosen, known as IP version 6
(IPv6)
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 22
CONSYL
IPv6 Header
0
15 16
vers:4
40
bytes
31
flow lable:28
payload length:16
next hdr:8
hop limit:8
source address :128
destination address :128
40 bytes fixed length header, no checksum, options are
replace by additional extension header
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 23
CONSYL
IPV6 address representation
16 bits eight hexadecimal value e.g.
4210:30:127F:9111:7801:DA0A:3232:44
5510:0:0:0:0:0:0:44 or 5510::44
Address with mixed environment of v4 and v6
x:x:x:x:x:x:d.d.d.d
e.g. 0:0:0:0:0:0.158.108.2.71
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 24
CONSYL
IPV6 key advantages
16 bytes fix length IP address support ~1000
million networks
IPv4 compatibility
self-configuration of workstations
support mobile workstations
improved security features
Department of Computer Engineering, Kasetsart University
204325 Introduction to Computer Communications and Networks
4/11/40 page 25