CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman1 Computer Networks Chapter 10 –...

41
CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 1 Computer Networks Chapter 10 – Connectionless Data Packet Formats

Transcript of CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman1 Computer Networks Chapter 10 –...

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 1

Computer Networks

Chapter 10 – Connectionless Data Packet Formats

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 2

Example Networks

• IP

• IPX

• IPv6

• CLNP

• AppleTalk

• DECnet

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 3

Connectionless Network Pieces

• Basic connectionless service– Format for data packets– Format & use for error messages/notifications

• Neighbor greeting– Nodes find routers on same link– Find if end node is on same link

• Routing– Moving packets toward destination node

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 4

IP Format

Version IHL

Type of Service

Total Length

Identification

Identification

0 DF MF Offset

Offset (continued)

Time to Live

Protocol

Header Checksum

Source Address

Destination Address

Options (var)

Padding (var)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 5

IPX Format

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 6

IPX+ Format

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 7

AppleTalk Format

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 8

IPv6 Format

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 9

DECnet Format

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 10

CLNP Format

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 11

Data Packet Format Comparisons• Destination/Source Address

– Variable length in CLNP, DECnet IV– Hierarchical in IPX and AppleTalk

(routers only look at net part)

• Destination/Source Sockets– IPX and AppleTalk – like UDP port

• Header Length– IP IHL – mult of 4 octets => padding, max 60– CLNP – octets, maximum of 254– IPv6 – handles variable length with option length

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 12

Comparisons (cont)• Packet Length

– Owed to Ethernet minimum packet length– All but DECnet (assumes layer 2 correct)

• Header Checksum– IP, AppleTalk – 1’s complement ARC– CLNP – 2 octet ARCs

• One like IP, but 8 bit instead of 16• Other “Fletcher’s checksum” Sum (Vi x i)

– IPX – ignored… watch this space!– IPv6, DECnet – none (slows router down)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 13

Comparisons (cont)• Fragmentation Allowed

– Both IP and CLNP have flag, opposite logic– IPv6 has info, but expects source to do it (!)

• Packet Identifier– For association of fragments– CLNP only has this if SP=1– IPv6 only has in optional fragment header– Only 16 bits in IP, CLNP (too short at Gbps)– 32 bits in IPv6

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 14

Comparisons (cont)• Fragment Offset

– Field is 0 in first fragment (or unfragged pkt)– All require fragments to be 8-octet multiples– IPv4, IPv6 – 13 bit field with 8-octet units– CLNP – 16 bit field with 1-octet units (!)– Optional in CLNP and IPv6

• Prefragmentation Length– Only CLNP has this (when SP=1)– Allows destination to reserve buffer space

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 15

Comparisons (cont)• More Fragments

– IPv4, IPv6, CLNP – flag for final fragment– Useless in CLNP due to Total Length field

• Lifetime– Second most useful field in the lot of ‘em– Decrements in IP (sec), CLNP (.5 s) by time– Decrements in IPv6 by hop– Increments by hop in IPX, DECnet, AppleTalk

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 16

Why Have Lifetime?• Routing Inconsistencies while updating

– Kill looping packets

• Limiting multicast range– Allow source to select appropriate cost

• Traceroute – Set incrementally and get error reports

• Reuse of connection IDs, etc.– Constrain maximum persistence of packet in the NW– Better to have transport layer use large fields

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 17

Comparisons (cont)• Version

– IPv4, IPv6, CLNP, DECnet – have it– IPX did not – used destination socket for IPX+– AppleTalk – used frame format to decide version!!

Created problems with bridges!

– Nice for adding features, but not necessary

• Padding– IPv4, CLNP, DECnet pad header– DECnet – padding in front of packet with flag

Only use a pad length field if padding is present

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 18

Comparisons (cont)• Protocol Field

– IPv4, IPv6, DECnet, AppleTalk, IPX have it– 1 byte long = next layer protocol– DECnet Phase III did not have it

• Added by clever use of first byte of NSP header

– TLV encoding in IPv6– CLNP uses type and addresses

• Last octet of address is virtually same as protocol

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 19

Comparisons (cont)• Type

– CLNP has this for management protocols– 28 is data, 1 is error report, 2,4,6 are IS-IS,…– RTS flag in DECnet distinguishing data/error

• Error Report Requested– DECnet RQR, CLNP E/R– Typically ask for this initially, then turn off– IP, IPv6 use ICMP, assume always desired

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 20

Comparisons (cont)• Congestion Feedback

– Source Quench – ICMP error message– DEC bit (C bit in CLNP) – piggybacked– In TOS field of IPv4, IPv6, DECnet Phase IV– Speed of notification, overhead,…

• Forward vs. Backward Congestion Notif.– Fwd can piggyback (no added traffic, easy)– Fwd can alert before too congested– But pkt with bit set may be dropped

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 21

Comparisons (cont)• Type of Service (TOS)

– IPv4, IPv6, CLNP have it– Intended to indicate special aspects of pkt– Currently still under experimentation

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 22

Type of Service

precedence D T R unused

IPv4 TOS

• IPv4 TOS – 8 bits– Precedence 0 (low) – 7 (high)– D=1 low delay, =0 “normal”– T=1 high throughput, =0 “normal”– R=1 high reliability, =0 “normal”

• (What is “normal” anyway?)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 23

CLNP QoS Maintenance & Priority

D/CS/D Cformat R E/D E/C

CLNP Globally Defined QoS

• Globally defined QoS Option (opt. code 201)– Format=11 to indicate globally defined QoS– R = reserved– S/D – sequencing vs. delay (=1 keep order)– C – Congestion experienced– D/C – delay vs. cost (=1 low delay important)– E/D – Residual error rate vs. delay (=1 reliable)– E/C – Residual error rate vs. cost (=1 reliable)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 24

TOS Issues

• Multiple Metrics considered harmful– Delay and bandwidth pretty much the same– Error rate is just weird– Extra configuration costs, complexity– More or larger routing messages– More computation for routing

• Congestion control– 1 bit to notify end node if congestion seen– 1 bit to advise router to drop packet

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 25

Service Class Categories

• Directives (handled link by link)– Link encryption, hop-by-hop error recovery, priority,

ordering, etc.– Easy to implement

• Metrics– Delay, cost, bandwidth, reliability

• Constraints– Avoid domain, use free links, etc.– Difficult to impossible, but may be necessary

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 26

CLNP Options

• TLV coded– Security and QoS use 2 MSBs as

• 00 = reserved• 01 = source addr specific (sender authority defined)• 10 = destination addr specific (receiver auth defined)• 11 = globally unique (in spec)

#octets11

0-254

Option code

length

value

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 27

IP Options

• Also TLV coded– Copy=1 copy option into every fragment– Class (2 bits)

• 00 = control• 01,11 = reserved• 10 = debugging/measurement

– Number (5 bits) – specifies option

copy class numberIP option first byte

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 28

IP 1-byte Options

• Two one-byte options– Code indicates that there is no length field

• End-of-option-list: option 0 – Last option in header

• No option: option 1– Padding (even internally)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 29

IP and CLNP Options

• Security

• Source Routing – Loose– Strict

• Route Recording– Record path taken

• Internet Timestamp (IP): Class 2 number 4– 32-bit timestamps, maybe with addresses

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 30

Route Recording Option

• P/C – allow non-implementing routers to ignore; otherwise drop (IP always partial)

• Same format as source routing

• Source allocates space for route data

• If route full, forward, even if “Complete”– Set pointer to 0xFF if can’t add address

type length Route dataIP route record option pointer

type length Route dataCLNP route record option pointerP/C

P/C = 0 for “partial”, 1 for “complete”

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 31

Internet Timestamp Option (IP)

• 32-bit Timestamp ms. since midnight UTC• If no space left, then increment OFL• Flag=1 then all routers record address• Flag=3 then source specifies router addrs

x1000100

length

pointer

OFL flag

Copy flag, class 2, option 4

Info(variable)

1 octet

Where to store next hop info

OFL holds overflow countFlag indicates what to record

timestamp

address

timestamp

Flag = 0

Flag = 1 or 3

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 32

Source Routing Option

• P/C flag as before (complete/partial)

• Segts Remaining compacts pointer field

• Unused to align addrs on 8-octet boundary– (Type and length of next header already there)

type length Route dataIP source route option pointer

Type=200 length Route dataCLNP source route opt. pointerP/C

SR type Segt R Route dataIPv6 source route option unused

1 1 4 multiple of 16 octets

Type=131 loose; Type=137 strict

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 33

Source Routing• Strict

– Specifies exact route (must hit all in order)– Useful if source does not trust NW to route– Useful to avoid distrusted nodes

• Loose– Specifies some routers to visit in order– Useful when not all addresses recognized– Useful to control some aspects of route– Only type (type 0) in IPv6

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 34

Source Route Addr Handling• Overwrite SR addr with outgoing link addr

– IP changes its address in SR info from the incoming to the outgoing link address

• Overwrite DA with next SR address– Done in IPv4 and IPv6 – fixed address lengths– Can’t be done in CLNP (variable lengths)– Could cause looping in CLNP

• Non-implementing routers just use DA• Forced loose SR option to be mandatory in CLNP

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 35

Error Messages• CLNP

– Handled as a type

• IPv4 – ICMP– Carried in IP packet as body (protocol = ICMP)

• IPv6 – modified ICMP– Next header indicates ICMP message (58)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 36

CLNP Error Messages• Type = 1 instead of 28 (data packet)

• Predicated by E/R = 1

• Reason coded in header option (0xc1)

• 2 octets: type + location

• Returned packet includes NW header + ???

• Segmentation not permitted – Truncated instead– Never done for data packets

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 37

ICMP• Type (1 byte)

• Code (1 byte)

• Checksum (2 bytes)

• Type-specific (2 bytes)

• Payload (variable)– Internet header– First 8 octets of datagram payload

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 38

ICMP Message Types• Echo Request/Reply – “ping”

• Timestamp Request/Reply– ID and sequence #– 32-bit timestamps– Originate / Receive / Transmit

• Information Request/Reply

• Address Mask Request/Reply

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 39

ICMP Message Types (cont)• Destination Unreachable

– net/host/protocol/port/fragmentation/SR failed

• Parameter Problem– Pointer to offending parameter

• Time Exceeded – en route / in reassembly

• Source Quench– Backward congestion notification

• Redirect (routing)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 40

IPv6 Error Messages

• Similar to ICMP

• Use “next header” value=58

• Type (1 octet)– Type<128: error– Type>127: informational

• Code (1 octet)

• Checksum (2 octets)

CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman 41

IPv6 Error Messages (cont)

• Errors– 1=Dest unreachable/code says why– 2=Packet too big/code gives hop MTU– 3=Time exceeded/code says hops vs. reass.– 4=Parameter problem/code says type

• Informational – like echo request/reply– 128=echo request– 129=echo reply