IP : Internet Protocols. Agenda IP functions IP header format IP routing Fragmentation IPng’s...

29
IP : Internet Protocols IP : Internet Protocols

Transcript of IP : Internet Protocols. Agenda IP functions IP header format IP routing Fragmentation IPng’s...

IP : Internet ProtocolsIP : Internet Protocols

Agenda

• IP functions• IP header format• IP routing• Fragmentation• IPng’s overview

Connectionless Delivery System

Most fundamental internet service

consists of a packet delivery system Service is defined as

Unreliable Best-effort Connectionless

Purpose Of Internet Protocol

Protocol that defines the unreliable,

connectionless delivery mechanism is

called Internet Protocol and usually

called IP IP has 3 important definitions

Basic unit of data transfer used

throughout a TCP/IP internet IP software perform the routing

function Including a set of rule that embody

the idea of unreliable packet delivery

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

IP attributes

handle data unit called IP datagrams

connectionless protocol - doesn’t promise reliable delivery

best effort delivery packets may be lost, out out

sequence, or duplicated due to various reasons

IP encapsulation

with Ethernet frame

Ethernet hdr IP header data

IP datagrams

IP reframing

IP 158.108.33.4MAC 0:0:e8:15:cc:c

IP 158.108.2.71MAC 0:0:33:10:a:c

IP 158.108.2.1MAC 0:0:c:6:12:40

A B

• IP will reframe the packet when A send data to B

IP 158.108.33.1MAC 0:0:c:6:13:4a

Change MAC address, IP address be the same

MAC destMAC src

typeIP sourc

eIP dest

0:0:c:6:13:4a0:0:e8:15:cc:c0x800158.108.33.4158.108.2.71

packet to routerŒ

MAC destMAC src

typeIP source

IP dest

0:0:33:10:a:c 0:0:c:6:12:400x800158.108.33.4158.108.2.71

packet from router

IP datagrams

4 4 8vers: hlen: TOS: total length16:

16 3identification: flags: frag of13fset:

hhhhhh hhhhhh: 8 : 8 16um :

32source address :

hh h3 2

32options and padding :

hhhh:

0 15 16 31

20bytes

IP header details (1)• vers - version = 4• hlen - - header length in 32 bit words,

– 5 20with no options, hlen = = bytes

• TOS - type of service, desired quality of services

0 0Prec. D T R

0 1 2 3 4 5 6 7

bits if 0 if 10-2 Precedence 3 Normal delay Low delay4 Normal throughput High throughput5 Normal Reliability High reliability6-7 Reserved

IP header details (2)

Total length - length of datagrams (incl. header), max datagrams is 64K

identification, flags, fragmentation - use to segmentation and reassembly packet

TTL - Time to live, defining max number of routers through which the datagrams

may pass (hop count)-- ttl decrease each router it passes a router

normally set to 30 if ttl == 0 discard and send ICMP TTL exceeded to source ee eeeeeeee eeeeeeee

IP header details (3) Protocol - higher-level protocol that provides

data1 = datagrams carries an ICMP messages6 = datagrams carries an TCP segments17 = datagrams carries an UDP datagrams

header checksum - 16 bit one’s compliment, note that there is no data checksum

source address - 32 bit IP source address destination address - 32 bit IP destination

address option and padding - additional info to control

functions such as routing and security

Routing routing is a 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 availableselecting the best path for a particular purposeusing those paths to reach other networks

devices which perform routing are routers (historically call IP gateways)

Routing Table

Every router contains a routing table of the network numbers

The table records which connection can be used to

reach a particular networkplus some indication of the

performance or cost of using connection

Routing Table form

• Routing Table form– <network, gateways, others>

% -netstat rn Destination Gateway Genmask Flags MSS Window

irtt Iface

1581083200000 255255255192 1500 0. . . . . . . . . U 00

127 0 0 0 0 0 0 0 255 0 0 0. . . . . . . . . U ee3584 0 0

0000 158108321 0000 1 500 0

0 e

How to create routing table

IP does not create routing table by itself

Normal 3 ways to create routing tablestatic route - by hand

% route add 158.108.20.0 158.108.33.1

dynamic routes - via routing protocolvia ICMP redirect

Routing Protocol

Routing protocol manages and updates routing table on each network node

often implemented in UNIX using one of the two daemons:routed : basic routing daemon for

interior routing, normally with RIPgated : sophisticated daemon for

interior and exterior routing, with additional protocol such as OSPF, BGP

MTU revisited for fragmentation

The upper limit number of data byte in data link frame is call MTU (Maximum Transfer Unit)

Typical MTU (bytes)FDDI : 4325 Ethernet : 1500802.3 : 1492Point-to-Point : 296

If #bytes of datagrams to send>link layer’s MTU, IP breaks the datagrams up into smaller pieces (fragmentation)

Fragmentation fragmentation = processed used by IP to re

duced size of datagram that are too big for l ink connection MTU e.g. fragment 2000 byt

es to Ethernet (MTU=1500) fragments should be reassembled at the fin

al destination (expensive process) How ?

each fragment has its own header each fragment carries the same 16 bit identification numb

er - Each fragment must be aligned with an eight octet bounda

ry

Fragmentation flag Identification number

16 bits integer value used to identify all fragmentsThis id is not a sequence number!

flags - 3 bits control fragmentation

R DF MF

0= last fragment1= more fragments

0= may fragment1= don’t fragment

reserve, must be 0

eeeeeeee eeeeee - eeeeeeee eee eeeeeeee ee eeeee eee data from the startof the original datagram, measure in

8 octets unit

Fragmentation sample

…… 232 0 0 020. ..00

other header ident flags offset data

original

Ethernetwith MTUof 1500

... 111 1 0 0..1479

... 111 0 185 1480..2000

identification number

more fragment

last fragment

20 bytes 20 bytes

post 0 post 185*8=1480

Problem in fragmentation

The end node has no way of knowing how many fr agments there be. It has to manage enough buffe

r space to handle reassembly process. If any fragments lost, all datagram must be discar

ded End node starts a timer when received the first fr

agment, if any fragments fails to arrive (usually 3 0 secs), all datagrams must be discarded

Since the IP service is connection's. No attempt is made by IP to recover these situations, though IC

MP error message may be generated

Path MTU

Path MTU : the smallest MTU of data link between two distance hosts

Need not to be constant because routing mechanism

Avoid fragmentation by discover PATH MTU (RFC1191)

Use ICMP to determine PATH MTU

Avoiding fragmentation For datagrams within the same physical net

work, the MTU is known. TCP/UDP then use t he MTU to limit the message size pass to IP;

messages will never be fragmented. For datagrams passed to diff net, not easy to

know the MTU! standard recommends that all networks sup

porting TCP/IP have an MTU of at least 576 bytes 512 20 20bytes data+ bytes TCP hdr + bytes IPeee eeee eeeeeee e eeeeee ee eee eeeee ee eeee ee eeeee eeeeeeeeee576

IPng

Problem of current IP address : limitatio n of 32 bit address space

1990 : IETF defined a new version of IP, g enerally called IP Next Generation or IPn

g

Spring 1 9 9 2 : IAB issues IPv7 , propo sed the OSI CLNP(connectionless NetworkPro

tocol) as the basis of IPv7 . Finally rejected by I ETF andworki nggroups

IPV6 1992 7End : proposals for IPng

eee eee eee ee e eeeeeeee , , , , eeeee, , /

e eeeeeeeeeeeee e3: eeee eee ee e e eee eeeeee eee+ / => (

ress: RFC 1 3 4 7 ) TP/IX => CATNIP (Common Architecture for the Ne

xtGeneration InternetProtocol :RFC1 7 0 7 ) SIP+IP encaps+PIP=> SIPP (Simple Internet Protoc

1710ol Plus: RFC )

ee eeeeeee e eeeeee1994 : ,6( 6)

IPv6 Header

:4 : 2 8

eee : 1 6 : 8 :8

destinationaddress:1 2 8

sourceaddress:1 2 8

0 15 16 31

40bytes

40 bytes fixed length header, no checksum, options are replace by additional extension header

IPV6 address representation

16 bits eight hexadecimal value e.g. 4210:30:127F:9111:7801:DA0A:3232:445510:0:0:0:0:0:0:44 or 5510::44

Address with mixed environment of v4 and v6x:x:x:x:x:x:d.d.d.de.g. 0:0:0:0:0:0.158.108.2.71

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