3 Internet Protocol: 3. Internet Protocol: Connectionless Datagram

advertisement
3. Internet Protocol:
3
Connectionless Datagram Delivery
최양희
서울대학교 컴퓨터공학부
MMlab
1
Introduction
ƒ Internet architecture and philosophy
Application Services
Reliable Transport Service
Connectionless Packet Delivery
Service
IP p
packet delivery
y service
•
•
•
•
•
Unreliable: lost, duplicated, delayed, or delivered out of order
Best-effort
Connectionless
Variable size datagrams
Data forwarding only (routing, error, and control by other
protocols)
MMlab
2
IP Features
ƒ Interconnecting end systems across multiple
networks
ƒ Implemented everywhere (end system, router)
ƒ High level protocol data encapsulated in IP Protocol
Data Unit (PDU)
ƒ IP version 4 (rfc 791
791, in 1981)
ƒ IP version 6 (IPv6) (rfc 2460, in 1998)
MMlab
3
Router Features
ƒ Coping with the differences among networks
• Addressing
Add
i schemes
h
• Maximum packet size
• Hardware
H d
and
d software
ft
iinterfaces
t f
• No assumption on network reliability
MMlab
4
IP datagram
HEADER
DATA
MMlab
5
IP encapsulation
IP Header
Frame Header
IP Data
Frame Data
MMlab
6
Transmission across
Internet
MMlab
7
IP Datagram Forwarding
ƒ Delivers datagrams to destination subnetwork
ƒ Routers
R t
maintain
i t i a routing
ti ttable
bl off nextt h
hops
ƒ Next hop field does not appear in the datagram
Net 1
Table at R2
R1
Net 2
Destination
Net 1
Net 2
Net 3
Net 4
R2
Net 3
R3
Net 4
Next Hop
Forward to R1
Deliver Direct
Deliver Direct
Forward to R3
MMlab
8
Routing Table
ƒ IF ((Mask[I] & Destination_Address) = Destination [I])
Forward to NextHop [I]
30.0.0.7
Net 1
30.0.0.0
40.0.0.8
R1
Net 2
40.0.0.0
40.0.0.7
Destination
30.0.0.0
40 0 0 0
40.0.0.0
128.1.0.0
192.4.10.0
R2
128.1.0.9
Net 3
128.1.0.0
128.1.0.8
Mask
255.0.0.0
255 0 0 0
255.0.0.0
255.255.0.0
255.255.255.0
MMlab
R3
Net 4
192.4.0.0
192.4.10.9
Next Hop
40.0.0.7
Deliver Direct
Deliver Direct
128.1.0.9
9
IPv4 Datagram Format
0
4
8
VERS HLEN
16
19
SERVICE
TYPE
24
31
TOTAL LENGTH
IDENTIFICATION
FLAGS
TIME TO LIVE PROTOCOL
FRAGMENT OFFSET
HEADER CHECKSUM
SOURCE IP ADDRESS
DESTINATION IP ADDRESS
IP OPTIONS (IF ANY)
PADDING
DATA
...
MMlab
10
IP Format
ƒ Version (4 bits)
ƒ Internet Header Length (4 bits) : in 32-bit
32 bit words
Min header is 5 words
ƒ Type of Service (8 bits)
Precedence delay
Precedence,
delay, reliability,
reliability throughput
ƒ Total Length (16 bits)
header + data in bytes, less than 64KB
ƒ Identifier (16 bits)
uniquely identifies the datagram during its life
ƒ Flags (3 bits)
M
More
fl
flag, N
No ffragmentation
t ti
ƒ Fragment offset (13 bits) in units of 8 bytes
ƒ Time to live ((8 bits)) in router hops
p
MMlab
11
IP Format (cont’d)
ƒ Protocol (8 bits)
Next level protocol to receive the data
ƒ Header Checksum (16 bits)
One’s complement sum of all 16-bit words in the header
ƒ Source Address (32 bits)
Original source. Does not change along the path
ƒ Destination Address (32 bits)
Final destination.
destination Does not change among the path
ƒ Options (variable)
ƒ Padding (variable)
M k h
Makes
header
d llength
th a multiple
lti l off 4 b
bytes,
t
zero iis iinserted
t d
ƒ Data (variable)
Data + header < 65,535 bytes
MMlab
12
Service Type
0
1
2
PRECEDENCE
3
4
5
D
T
R
6
7
UNUSED
D
low delay
T
high throughput
R
high reliability
Precedence=importance of datagram
===> hint to routing algorithm
MMlab
13
DiffServ
0
5
CODEPOINT
6
7
Unused
64 different services
xxx000 for original definition
precedence 6 or 7 for routing
p
g traffic
MMlab
14
Fragmentation
ƒ Datagram Size, Network MTU, and Fragmentation
• MTU ((maximum Transfer Unit):
) fixed upper
pp bound on the amount
data that can be transferred in one physical frame
e.g.) Ethernet: 1500 octets, FDDI: 4470 octets
• Fragmentation: dividing large datagrams into smaller pieces when
the datagram needs to traverse a network that has a small MTU
• Fragments must be reassembled at the destination
• If any fragments are lost, the datagram cannot be reassembled.
• Reassembly timer : if expired, discard the received packets
ƒ Fragmentation control
• IDENTIFICATION : identical to the fragments
• FLAGS: Don’t Fragment bit, More Fragments bit,
• FRAGMENT OFFSET : by 8 octets
ƒ No sequence number
MMlab
15
Fragmentation
HOST
A
HOST
B
Net 1
MTU=1500
R1
Net 2
MTU=620
MMlab
R2
Net 3
MTU=1500
16
Fragments
Datagram
Header
Data1
600 octets
Data2
Data3
600 octets 200 octets
Fragment 1
Data1
Header
600 octets
Fragment 1 (offset 0)
Fragment 2
Data2
Header
600 octets
Fragment 2 (offset 600)
Fragment 3
Data3
H d
Header
200 octets
t t
Fragment
g
3 ((offset 1200))
MMlab
17
Internet Datagram Options
ƒ Included primarily for network testing or debugging
ƒ Type(code)- Length-Value
ƒ Option code (1 octet)
0
1
2
COPY OPTION CLASS
3
4
5
6
7
OPTION NUMBER
ƒ Copy = 1
option copied to all fragments
copied to the first fragment only
=0
ƒ Class = 0
Datagram or network control
=1
Resv’d
Debugging and measurement
=2
=3
Resv’d
ƒ Option length (1 octet)
ƒ Value
V l : variable
i bl llength
th
MMlab
18
IP Options
ƒ Loose Source Routing
ƒ Record
R
dR
Route
t
ƒ Strict Source Routing
ƒ Internet Timestamp etc.
MMlab
19
Record Route Option
0
8
16
24
31
CODE LENGTH POINTER
FIRST IP ADDRESS
SECOND IP ADDRESS
……...
MMlab
20
Strict Source Route Option
0
8
16
24
31
CODE LENGTH POINTER
IP ADDRESS OF FIRST HOP
IP ADDRESS OF SECOND HOP
……...
Addresses overwritten by visited routers
(= record route)
MMlab
21
Timestamp Option
0
8
16
24
31
CODE LENGTH POINTER OFLOW FLAGS
FIRST IP ADDRESS
FIRST TIMESTAMP
……...
In msec since midnight
OFLOW : countt off routers
t
that
th t couldn’t
ld ’t supply
l timestamps
ti
t
because the option was too small
FLAGS : record timestamps only (0)
(0), etc
etc.
MMlab
22
IPv6 PDU General Form
40 octets
IPv6
header
0 or more
Extension
header
…..
MMlab
Extension Transport-level
header
PDU
23
IPv6 Header
4
8
12
16
24
31
Flow label
Version traffic class
Payload length
Next header Hop limit
Source
Address
40 octtets
0
Destination
Address
MMlab
24
IPv6 Header
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
Version = 6
Traffic Class (8 bits)
Flow Label (20 bits)
Payload length (16 bits) : in octets except the IPv6 header
N tH
Next
Header
d (8 bit
bits)) : identifies
id tifi the
th type
t
off header
h d following
f ll i the
th
IPv6 header
Hop Limit (8 bits) : remaining number of allowable hops for this
packet
Source Address (128 bits)
Destination Address ((128 bits)) : may
y not be the ultimate
destination, if routing header is present
40 octets in length
MMlab
25
Flow Label
ƒ A Flow is uniquely identified by source address and
20 bit flow label
20-bit
label.
ƒ A flow may comprise single or multiple TCP
connections.
connections
ƒ A single application may generate a single or multiple
flows (multimedia conferencing).
ƒ At router, the same flow has the same path, resource
allocation,, discard requirements,
q
, accounting,
g, and
security attributes.
MMlab
26
Header Order
ƒ IPv6 header : mandatory
ƒ Hop-by-Hop Options header
ƒ Destination Options header
to be processed by destinations in the IPv6 header and Routing
header
ƒ Routing header : extended routing (source routing)
ƒ Fragment header
ƒ Authentication header
ƒ Encapsulating Security Payload header
ƒ Destination Options header
to be processed by destination in the IPv6 header
ƒ upper-layer header (TCP, application etc.)
MMlab
27
IPv6 Fragmentation
ƒ End-to-end
ƒ Does
D
nott accommodate
d t route
t changes
h
ƒ Use Path MTU Discovery to determine minimum
MTU in the path
ƒ Minimum MTU is 1280 octets
MMlab
28
Download