[N ETWORKING ] Encapsulation and Layering Packets grow with headers - - PDF document

n etworking
SMART_READER_LITE
LIVE PREVIEW

[N ETWORKING ] Encapsulation and Layering Packets grow with headers - - PDF document

CS455: Introduction to Distributed Systems [Spring 2020] Dept. Of Computer Science , Colorado State University CS 455: I NTRODUCTION T O D ISTRIBUTED S YSTEMS [N ETWORKING ] Encapsulation and Layering Packets grow with headers and trailers As


slide-1
SLIDE 1

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.1

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS

[NETWORKING]

¨ Shrideep Pallickara ¨ Computer Science ¨ Colorado State University

Encapsulation and Layering Packets grow with headers and trailers As they trickle down successive layers A small price to pay For keeping complexity at bay

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Frequently asked questions from the previous class survey

¨ Manchester encoding: problems? ¤ Too many transitions ¨ Differences: NRZ and NRZI ¨ Designing protocols with petabyte throughputs? ¨ Which multiplexing is most common today? ¨ Tolerable loss rates in videos? ¨ How is IPv4 still being used? Aren’t we out of addresses? ¨ How is packet loss detected? ¨ 4B/5B codes: What if we encounter something not in the table? ¤ Error detection

slide-2
SLIDE 2

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.2

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Topics covered in today’s lecture

¨ Encapsulation ¨ OSI ¨ Internet Architecture ¨ IP routing

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

ENCAPSULATION

slide-3
SLIDE 3

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.3

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Example of a protocol graph

File App Digital Library App Video App RRP MSP HHP File App Digital Library App Video App RRP MSP HHP Host 1 Host 2

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Encapsulation

¨ RRP receives a set of bytes to transmit from the application ¤ E-mail, integers, images etc ¨ RRP is responsible for sending this data to its peer at the other end ¤ Must communicate control information to its peer ¤ Instruct how to handle the message

slide-4
SLIDE 4

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.4

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

When asked to transmit info, lower level layers add information to the message

¨ Attach a header to the message ¤ Small data structure ¤ Few bytes to several dozen bytes ¨ Control info at the end of message: trailer ¨ Format is specific to the protocol ¨ Data being transmitted: body or payload ¨ Application data is said to be encapsulated

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Encapsulating high-level messages inside low-level messages

Application Program

RRP HHP

Application Program

RRP HHP

Data Data

RRP

Data

RRP

Data Data

RRP

HHP Host 1 Host 2

slide-5
SLIDE 5

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.5

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Encapsulation: Some more info

¨ Low-level protocol does not interpret message given to it by high-level

protocol

¤ Cannot extract meaning ¨ Low-level protocol may apply simple transformations to the data it is

given

¤ Compress ¤ Encrypt

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Multiplexing is applicable up-and-down the protocol graph too

¨ RRP attaches header to every message that goes through it ¤ Header includes information to identify the application n Called demultiplexing key or demux key ¨ At the destination host, RRP strips its header ¤ Examines demux key ¤ Demultiplexes message to correct application

slide-6
SLIDE 6

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.6

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Demux key is used at all levels of the protocol stack

¨ Some use an 8-bit field {TCP (6), UDP (17)} ¤ Can support only 28 (256) high level protocols ¤ Can also be 16/32-bits ¨ There could be a single demultiplexing field ¤ Same demux key used at both ends ¨ There could be a pair of demultiplexing fields ¤ Each side uses different key to identify high-level protocol

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

OSI NETWORK ARCHITECTURE

slide-7
SLIDE 7

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.7

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

OSI network architecture

¨ Model is a product of the Open Systems Interconnection (OSI) project ¤ At the International Organization for Standardization (ISO) ¨ Partitions network functionality into 7 layers ¨ Physical Layer ¤ Handles transmission of raw bits ¤ Standardizes electrical, mechanical, and signaling interfaces

n 0 bit should be received as 0 not 1 COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

OSI network architecture: Data link Layer

¨ Collects stream of bits into a frame ¤ Puts special bit pattern at the start/end of each frame ¤ Frames, not raw bits, are delivered to host ¨ Compute checksum for frame ¤ Check for correctness and request retransmission ¨ Network adaptors & device drivers implement this

slide-8
SLIDE 8

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.8

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

OSI network architecture

¨ Network layer ¤ Handles routing among nodes in a packet-switched network ¤ Unit of data exchanged is packet not frames ¨ Layers implemented on all network nodes? ¤ Physical, data and network

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

OSI Architecture

Physical Application Presentation Session Transport Network Data link Transport Network Data link Application Session Physical Presentation Network Data link Physical Network Data link Physical

One or more nodes within the network Usually run only on the end host, not switches

slide-9
SLIDE 9

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.9

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

How messages flowing through the OSI stack will appear on the network

Data

Data link layer header Network layer header Transport layer header Session layer header Presentation layer header Application layer header Data link layer trailer

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

OSI network architecture

¨ Transport ¤ Implements process-process channel ¤ Messages {not packet or frame} ¨ Presentation ¤ Format of data exchanged between peers ¨ Session ¤ Namespace to tie different transport-streams that are part of the

application

slide-10
SLIDE 10

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.10

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

INTERNET ARCHITECTURE

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Internet architecture

¨ Evolved out of experiences with ARPANET ¤ Funded by ARPA of the US DoD ¨ Around before the OSI architecture ¨ Unlike OSI, this is a 4-level model

slide-11
SLIDE 11

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.11

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Internet protocol graph

FTP HTTP NV TFTP TCP UDP IP NET2 NET1 NETn …

Ethernet Fiber Distributed Data Interface End-to-End protocols

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Alternative view of the Internet Architecture

APPLICATION

NETWORK

IP

TCP UDP

slide-12
SLIDE 12

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.12

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Internet architecture

¨ DOES NOT imply strict layering ¤ Bypassing immediate lower layers is possible ¨ Layer has an hour-glass shape ¤ Wide at top and bottom ¤ Narrow in the middle ¤ IP is the focal point of the architecture

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Protocol implementation issues Where are the processes?

¨ Process-per-protocol ¨ Process-per-message

slide-13
SLIDE 13

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.13

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Protocol implementation issues Process-per-protocol model

¨ Each protocol implemented in separate process ¨ Process/protocol passes message to another process/protocol ¨ Context-switch required at each level of the protocol graph ¤ Expensive!

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Process-per-message model: Associate processes per message

¨ Treat each protocol as a static piece of code ¨ Protocol graph traversed in sequence of procedure calls ¨ When message arrives: ¤ Dispatch process to move message up the protocol graph ¤ At each level procedure implementing protocol is invoked ¨ Sending message? ¤ Application process invokes appropriate procedures

slide-14
SLIDE 14

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.14

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Comparison

¨ Process-per-protocol ¤ Context switch per level ¨ Process-per-message ¤ Procedure call per level

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

INTERNETWORKING

slide-15
SLIDE 15

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.15

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Internetwork

¨ Arbitrary collection of interconnected networks ¤ To provide some sort of host-host packet delivery service ¨ Network of networks ¤ Made up of lots of smaller networks

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

A simple internetwork

H1 H2 H3

Network 2 (Ethernet)

H8 H7 R3

Network 1 (Ethernet) Network 4 (point-to-point)

H5 H6 H4 R2 R1

Network 3 (FDDI) Fiber Distributed Data Interface (FDDI)

slide-16
SLIDE 16

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.16

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Internet Protocol (IP)

¨ Key tool to build scalable, heterogeneous networks ¨ Runs on all nodes (hosts and routers) ¨ Allows nodes and networks to function as a single logical network ¨ Possible to build an internetwork without IP ¤ But IP is the only one that has faced scale issues

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

A simple internetwork: Communication between H1-H8

H1 H2 H3

Network 2 (Ethernet)

H8 H7 R3

Network 1 (Ethernet) Network 4 (point-to-point)

H5 H6 H4 R2 R1

Network 3 (FDDI)

slide-17
SLIDE 17

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.17

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

H8 R3 R2 R1 H1

Example depicting how hosts (H1-H8) are logically connected

TCP IP ETH

FDDI

IP TCP IP ETH IP

FDDI

PPP IP PPP ETH ETH

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

The IP service model

¨ Datagram model of delivery ¤ Connectionless ¤ Best effort ¨ Addressing scheme ¤ Identifies all hosts in the internetwork

slide-18
SLIDE 18

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.18

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Datagram delivery

¨ Datagram is a type of packet ¤ Sent in a connectionless fashion ¨ No need for any advance setup mechanisms ¤ That tell network what do when packet arrives ¨ Every datagram contains enough information ¤ To forward packet to correct destination

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

The network makes a best effort to send datagrams across

¨ Things that could go wrong with the packets ¤ Lost ¤ Corrupted ¤ Misdelivered ¤ Out of order and duplicates ¨ When things go wrong, the network does nothing ¤ No attempt to recover from the failure

slide-19
SLIDE 19

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.19

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Keeping routers simple was one of the original design goals of IP

¨ Important to run over anything ¨ Putting extra functionality into routers to make up for network

deficiencies?

¤ Not a good idea ¨ Higher-level protocols/apps that run above IP need to be aware of

failure modes

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

The IP Packet format consists of a header followed by bytes of data

¨ Represented as a succession of 32-bit words ¨ Packet formats designed to align on 32-bit boundaries ¤ Simplifies task of processing in software ¨ Transmission order ¤ Top word transmitted first ¤ Leftmost byte of each word transmitted first

slide-20
SLIDE 20

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.20

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

The IPv4 packet header

Version HLen TOS Length Ident Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) Data

4 8 16 19 31

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IP Packet format [1/5]

¨ Version ¤ Makes it easy to redefine packet format later on ¨ HLen ¤ Specifies length of header in 32-bit words ¤ When there are no options (most of the time) n Header is 5 words or 20 bytes ¨ TOS (type of service) ¤ Allow packets to be treated differently n Based on application needs

slide-21
SLIDE 21

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.21

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IP Packet format [2/5]

¨ Length ¤ Length of the datagram in bytes ¤ Maximum size of IP datagram is 216 bytes ¨ SECOND WORD OF IP PACKET ¤ {Ident, Flags, Offset} ¤ Information about fragmentation

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IP Packet format [3/5]

¨ TTL (time to live) ¤ Hop-count not timer (as originally intended) ¨ Protocol field ¤ Demultiplexing key n Identifies higher-level protocol n TCP (6), UDP (17) ¨ Checksum ¤ Consider IP header as a sequence of 16-bit words

slide-22
SLIDE 22

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.22

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IP Packet format [4/5]

¨ SourceAddr ¤ Decide if packet should be accepted ¤ Also used for replies ¨ DestinationAddr ¤ Full address of destination ¤ Forwarding decisions are made at each router ¨ Presence or absence of options ¤ Can be checked based on size of HLen

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IP Packet format [5/5] TOS field {Type of Service}

¨ Meant to specify how the datagram should be handled as it traversed

the internet

¤ Preference for low delay ¤ Preference for high throughput ¤ Preference for high reliability ¨ In practice TOS was not widely implemented

slide-23
SLIDE 23

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.23

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

The 8 bits allocated to TOS can be divided into 5 parts

1 7

Precedence bits Indicates importance of datagram

6 5 4

Low delay

3

High throughput

2

High reliability

D T R

Unused 7: 7: Most Significant Bit 0: 0: Least Significant Bit

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Providing host-to-host service model over heterogeneous collection of networks

¨ Each network technology has its own idea of how large a packet can

be

¤ Ethernet v2: 1500 bytes ¤ FDDI: 4500 bytes

slide-24
SLIDE 24

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.24

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Every network type has a Maximum Transmission Unit (MTU)

¨ Largest IP datagram that it can carry in its frame ¨ Smaller than the largest packet-size of network ¤ IP datagram needs to fit in payload of link-layer frame

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Fragmentation necessary when datagram path includes network with smaller MTU

¨ All fragments carry same identifier in Ident

Ident field

¤ To enable fragment reassembly ¤ Chosen by the source host ¨ If all fragments do not arrive at receiving host?

① Receiver gives up reassembly [reassembly timeout: 15 seconds RFC0791] ② Discards fragments that did arrive

¨ IP does not attempt to recover from missing fragments

slide-25
SLIDE 25

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.25

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

A simple internetwork: Sending IP datagrams from H1 to H8

H1 H2 H3

Network 2 (Ethernet)

H8 H7 H4 H5 H6 R3 R2 R1

Network 1 (Ethernet) Network 4 (point-to-point) Network 3 (FDDI)

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IP datagrams traversing a sequence of physical networks

ETH IP 1400 FDDI IP 1400

H1 H8 R1 R2 R3

PPP IP 512 PPP IP 512 PPP IP 376 ETH IP 512 ETH IP 512 ETH IP 376

slide-26
SLIDE 26

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.26

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IPv4 Packet header

Version Version

HLen HLen TOS TOS Length Length Ident Ident

Flag Flag s

Offset Offset TTL TTL Protocol Protocol Checksum Checksum SourceAddr SourceAddr DestinationAddr DestinationAddr Options (variable) Options (variable)

Pad (variable)

Data Data

4 8 16 16 19 19 31 31 COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Header fields used in IP fragmentation:

Fragmentation occurs at 8-byte boundaries

Start of header Start of header Ident Ident = = x

DF Offset = 0 Offset = 0

Rest of header Rest of header 1400 data 1400 data bytes bytes Start of header Start of header Ident Ident = = x

1 Offset = 0 Offset = 0

Rest of header Rest of header 512 512 data data bytes bytes

Unfragmented packet Fragmented packet

slide-27
SLIDE 27

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.27

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Header fields used in IP fragmentation:

Fragmentation occurs at 8-byte boundaries

Fragmented packet

Start of header Start of header Ident Ident = = x

1

Offset = 64 Rest of header Rest of header 512 512 data data bytes bytes Start of header Start of header Ident Ident = = x

Offset = 128 Offset = 128

Rest of header Rest of header 376 376 data data bytes bytes

Fragmented packet

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IPV6 (AND COMPARING WITH IPV4)

slide-28
SLIDE 28

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.28

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IPv6 versus IPv4: Key Differences

¨ Source and destination addresses are 128-bits (16 bytes) in IPv6 ¨ IPv6 treats Options as extension headers ¨ To simplify processing of packets in routers, IPv6 did away with

fragmentation

¤ Responsibility for packet fragmentation is at the end points ¤ IPv6 hosts must perform : (1) path MTU discovery, (2) perform end-to-end

fragmentation, OR (3) send packets no larger than the default MTU=1280

¨ As of 2014, IPv4 still carried >99% of worldwide Internet traffic

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IPv6 Packet Header

Version Version

Traffic Class Traffic Class Flow Label Flow Label Payload Length Payload Length Next Header Next Header Hop Limit Hop Limit SourceAddr SourceAddr [16 bytes] [16 bytes] DestinationAddr DestinationAddr [16 bytes] [16 bytes]

4 8 16 16 19 19 31 31 12 12

IPv6 Packet Header is fixed at 40 bytes ... So there is no Header Length

slide-29
SLIDE 29

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.29

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IPv6 Packet Header: Some more details [1/2]

¨ Version: 4 bits [0110] ¨ Traffic Class: 6+2 bits ¤ Differentiated Services for QoS ¤ Anything that ends in 2 “1” bits is intended for experimental or local use ¨ Flow Label (20 bits) ¤ If it is non-zero: Serves as a hint to routers and switches with multiple

  • utbound paths that these packets should stay on the same path, so that

they will not be reordered

¨ Payload length (16 bits): Size of payload including extension headers

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IPv6 Packet Header: Some more details [2/2]

¨ Next Header (8 bits) ¤ Specifies the type of the next header ¨ Hop Limit (8 bits) ¤ Replaces the time-to-live field of IPv4 ¨ Destination and Source Addresses (128-bits or 16 bytes each) ¨ Note: The IPv6 packet header has no checksum ¤ Transport or application layer protocols are assumed to provide sufficient

error detection

slide-30
SLIDE 30

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.30

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Structure of the IPv6 Packet

IPv6 Header Extension Headers Upper Layer Protocol Data Unit (PDU)

Payload IPv6 Packet PDU typically contains an upper layer protocol header and its payload. For e.g.: a TCP segment, UDP Datagram, or an ICMPv6 message

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

Extension Header

¨ If the Next Header field is non-zero ¤ It defines an extension header ¨ Current extension header types ¤ Information for routers, route definition, fragment handling, authentication,

encryption, etc.

¨ Each extension header has a specific size and defined format ¨ If an extension header is present? ¤ Follows the basic header and precedes the payload AND ¤ Includes a Next Header

slide-31
SLIDE 31

SLIDES CREATED BY: SHRIDEEP PALLICKARA L3.31

CS455: Introduction to Distributed Systems [Spring 2020]

  • Dept. Of Computer Science, Colorado State University

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

IPv6 Extension Headers: The chain of pointers using the Next Header field

IPv6 Header Next Header=6 (TCP)

TCP Segment

IPv6 Header Next Header=43 (Routing)

TCP Segment

Routing Header Next Header=6 (TCP) IPv6 Header Next Header=43 (Routing)

TCP Segment

Routing Header Next Header=51 (AH) Authentication Header Next Header=6 (TCP)

Each extension header must fall on a 64-bit (8-byte)

  • boundary. Use Padding to get there if less than that.

Fragmentation Header: 44

COM

OMPUTE TER SCI CIENCE NCE DEPAR EPARTMEN ENT

Professor: SHRIDEEP PALLICKARA CS455: Introduction to Distributed Systems ht http: p://www.cs. cs.co colost state.edu/~cs4 cs455

The contents of this slide-set are based on the following references

¨ Computer Networks: A Systems Approach. Larry Peterson and Bruce Davie. 4th edition.

Morgan Kaufmann. ISBN: 978-0-12-370548-8. Chapter [4]