You are on page 1of 57

Internet

IP

IP
:
1. :
;
2. :
;
:


( )
host host



host

IP

IP

To IP (Internet Protocol)

4 (IPv4)

RFC 791 (1981)

6 (IPv6)

RFC2460 (1998)
6/6/2012

World Ipv6 Launch

5;

Internet Stream Protocol (ST, ST-II,


ST2+) 90
5 IP

TCP

TCP

TCP

IP

Host

IP

IP

IP

IP

IP

IP

Host

IP Internet
1 (Ethernet)

H7

H2

H1

R3

H8

H3
4
(point-to-point)

2 (Ethernet)
R1
R2

H4

3 (FDDI)

H1

H5

TCP

R1

ETH

R2

IP

IP
ETH

R3

IP
FDDI

FDDI

H8

H6

IP
PPP

PPP

TCP
IP

ETH

ETH

Internet Protocol (IP)

IP

IP:

IP


HTTP FTP SMTP


TCP UDP

IP

DLC

Internet
host :
: TCP, UDP


RIP, OSPF, BGP

IP

ICMP


Internet

Internet

ICMP, IGMP, BOOTP, DHCP

RIP, OSPF, PIM, BGP (


, .,
)

ARP, RARP (
)

OSI
TCP/IP
ping

HTTP

Telnet

FTP

TCP

DNS

BGP
IP

PIM
OSPF

ARP

Ethernet

UDP

ICMP

IGMP

SNMP

DHCP

RIP

RARP


IP

IP


IP
(unreliable) (connectionless)
(datagram)
IP
,
(best effort)

IP



(
)
IP

IP (
, , )

IP

Internet Protocol (IP)

connectionless:

unreliable:

best effort:

datagram:

A
D

R2
H

R1

R3
R4

IP

IP :

-- (unicast)
-- (, broadcast)
-- ( , multicast)

IP -
IP
(IGMP, )

unicast

broadcast

multicast

IP

IP version 4
0

Version

8
IHL

16
DS/ECN

Identification
Time to Live

19

31

Total Length
Flags

Protocol

24

Fragment Offset
Header Checksum

Source IP Address
Destination IP Address
Options

Padding

(1)

6 bytes
destination address
4 bytes

source address
type

Ethernet Header

CRC

IP Header

TCP Header

Application data

Ethernet Trailer

Ethernet frame

Ethernet IP

6 bytes
00:e0:f9:23:a8:20
4 bytes

0:a0:24:71:e4:44
0x0800

Ethernet Header

CRC

IP Header

TCP Header

Application data

Ethernet Trailer

Ethernet frame

(2)
32 bits
version
(4 bits)

header
length

DS

flags
(3 bits)

Identification (16 bits)


TTL Time-to-Live
(8 bits)

Total Length (in bytes)


(16 bits)

ECN

Protocol
(8 bits)

Fragment Offset (13 bits)


Header Checksum (16 bits)

Source IP address (32 bits)


Destination IP address (32 bits)

Ethernet Header

IP Header

TCP Header

Application data

Ethernet Trailer

Ethernet frame

IP
32 bits
0x4

0x5

0x0

0x0

9d08
12810

4410
0102

00000000000002

0x06

8bff
192.168.137.144
192.168.71.21

Ethernet Header

IP Header

TCP Header

Application data

Ethernet Trailer

Ethernet frame

IP

byte
IP;

:

1. bit 0-7
2. bit 8-15
3. bit 16-23
4. bit 24-31

byte (network
byte order) big endian ordering

little endian

Big endian little endian


byte
.. 4 byte

Byte3 Byte2 Byte1 Byte0

Little Endian

byte

byte

Big Endian

byte
byte

Base Address+0
Base Address+1
Base Address+2
Base Address+3

Base Address+0
Base Address+1
Base Address+2
Base Address+3

Intel

Byte0
Byte1
Byte2
Byte3

Motorola

Byte3
Byte2
Byte1
Byte0

IP (1)

4, 5 ST II, IP v6 6

32 bit
( 60
byte)
5 (20 byte)

Internet header length (IHL)

DS/ECN (Differentiated Services/Explicit Congestion


Notification )


. TOS (Type of
Service). ,

(Total length)

byte (min 20, max 65.535)


(TOS)

(Precedence)

(Delay)

(1 bit)

(Reliability)

(1 bit)

(Throughput)

8 (3 bit)

(1 bit)

(2 bit)


(Differentiated Services DS)

(Codepoint DSCP)

64 (6 bit): bit

xxx000 ( 5 6
)
xxxxx0 IETF
xxxx11
xxxx01

(Explicit Congestion
Notification ECN)

2 bit (codepoints) IP (ECT, CE) + 2 bit


TCP:
TCP

00 not-ECT (ECN Capable Transport)


11 CE (Congestion Experienced)
01 ECT (1)
10 ECT (0)

IP (2)

(Identification)

(Flags)

host


( )

bit 0
Dont fragment bit ( ,
)
More fragments bit ( , ,
)

(Fragmentation offset)

(0
) byte

IP (3)

(Time to live)





,
1 sec

IP

IP

TTL ,

( )

IP (4)

(Protocol)

: IP!
4 = IP-in-IP
encapsulation

6 = TCP

17 = UDP

1 = ICMP

2 = IGMP

IP

IP (5)

(Header checksum)

,
, TTL

(16 bit)
16 bit
0

IP (6)

(Source address)

(Destination address)

IP (7)

(Option data)

fast path


byte
Max ( )
65.535 byte

(Padding)
(User data)

IPv4

IPv4 ( 4 byte)

4
1 byte

1 byte


max. 65535

1 byte

1 byte

IHL ( byte)

FLAG

.


(+ )


.. 6=TCP, 17=UDP

(3 bit),
D, T, R, 2 bit

( , TCP UDP)

IPv6
32 bit
Traffic Class
(8 bit)
Payload Length
(16 bit)

Flow Label
(20 bit)
Next Header
(8 bit)

Source IP address
(128 bit)

Destination IP address
(128 bit)

Hop Limits
(8 bit)

40 byte

version
(4 bit)

IPv6

:
IPv6
Version
Traffic class

Payload length

IPv4
Version
DiffServ
Total length

Next Header

Protocol

Hop Limit

TTL

Flow label:

40


IP

IHL: min 5 (20 byte), max 15 (60 byte),


40 byte
( )

(0 End of List, 1 No operation )

3 -

(1 byte)

Copy (1 bit):
Option class (2 bit): 00 , 10 , 01, 11

Option number (5 bit)


Copy

Option
Class

Option
Number

(Security)


( )

(Source routing)

IP

(Record Route)
(Time stamp)

(Source routing)

(strict=9):
(loose=3):

IP

IP
IP


Code=131/137

Length

Pointer

IP addr of 1st hop

IP address of 1st hop

IP addr of 2nd hop

IP address of 2nd hop

EOL

(Record route)

IP
4
byte
IP

,

40 byte , 9

Code=7

Length

Pointer

1st IP address

1st IP address

2nd IP address

2nd IP address

EOL

(Time stamp)


IP
msec UT
,
overflow counter [4 bit] flag [4 bit]

overflow:

flag: 0 , 1 +, 3

Code=68

Length

Pointer

Overflow Flags

1st IP address
1st time stamp

IP

IP 65.535 byte,


:

Ethernet 1500 byte


IP Ethernet
1500 byte

IP,

(MTU - maximum transmission unit)
, MTU

Ethernet: 1500
FDDI: 4352

802.3: 1492
ATM AAL5: 9180

802.5: 4464
PPP: 296

IP

IP
MTU;

IP

src, dest, id
offset, length, more bit


MTU;





!!

IP
:
in:
out: 3


;
Identification


Flags
DF = 1:
MTU
MF = 1: ()

Fragment offset


Total length

2400 byte
MTU 1000 byte

Header length: 20
Total length:
2400
Identification:
0xa428
DF flag: 0
MF flag: 0
Fragment offset: 0

Header length: 20
Total length:
448
Identification:
0xa428
DF flag: 0
MF flag: 0
Fragment offset: 244

Header length: 20
Header length: 20
Total length:
996
Total length:
996
Identification:
0xa428 Identification:
0xa428
DF flag: 0
DF flag: 0
MF flag: 1
MF flag: 1
Fragment offset: 122
fragment offset: 0

offset =
976/8

428 byte

IP

MTU: 4000

976 byte

MTU: 1000

offset 13 bit
byte
20 byte,
980 byte
8
980 976.

offset 0
976+20=996
offset 976/8=122
996,
offset 122+122=244
428+20=448

2400-20-976-976=428
2400

IP

(MTU <
)

IP
()
,

IP

, IP


,
ICMP


MTU (
)

IP


68 byte

host
576 byte

60 byte
8 byte

512 byte + 64 byte

host
576 byte

version

header
length

DS

Identification
time-to-live (TTL)

protocol

total length (in bytes)

ECN
0

D M
F F

Fragment offset
header checksum

, host
MTU (path MTU
discovery)
Path MTU MTU

< Path MTU,
!
?


(DF=1
IP)
, (ICMP)!

You might also like