17
Samples of Descriptive Samples of Descriptive Problems Problems CSC/ECE 573, Sections 001 Fall, 2012

Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Embed Size (px)

Citation preview

Page 1: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Samples of Descriptive ProblemsSamples of Descriptive Problems

CSC/ECE 573, Sections 001

Fall, 2012

Page 2: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

IP, FragmentationIP, Fragmentation A 3674 byte IP packet was fragmented by an IP

stack for transmission over a link whose MTU and DLC protocol limit the size of the IP packet to 1100 bytes. The original IP packet did not have any IP header options. State what the total length and fragment offset fields of each fragment produced by this stack will be.

Page 3: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

IP HeaderIP Header

Total Length in bytes (16)

Time to Live (8)

Options (if any)

Version(4)

Hdr Len(4) TOS (8)

Identification (16 bits) Flags (3) Fragment Offset (13)

Source IP Address

Destination IP Address

Header Checksum (16)Protocol (8)

PAD

Data Field

Page 4: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 4

One-hop deliveryOne-hop delivery

It is assumed that physical net methods can be used– But physical net capabilities might differ

Maximum Transmission Unit (MTU)– Largest IP packet a network will accept– Arriving IP packet may be larger– Solution: break into several packets

That is, “fragment”

IP Packet

MTU

Page 5: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 5

IP FragmentationIP Fragmentation If IP packet is longer than the MTU, the router

breaks packet into smaller packets– Called IP fragments– Fragments are still IP packets

Only data, header is replicated

– Router performs fragmentation

IP Packet 2 1

IP PacketsFragmentation

MTU

3

Page 6: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 6

Multiple FragmentationsMultiple Fragmentations Original packet may be fragmented multiple

times along its route

DestinationHost

InternetProcess

SourceHost

InternetProcess

Fragmentation

Page 7: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 7

DefragmentationDefragmentation Internet layer process on destination host

defragments, restoring the original packet IP Defragmentation only occurs once

DestinationHost

InternetProcess

Defragmentation

SourceHost

InternetProcess

Page 8: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 8

Fragmentation and IP FieldsFragmentation and IP Fields More Fragments field (1 bit)

– 1 if more fragments– 0 if not– Source host internet process sets to 0– If router fragments, sets More Fragments field

in last fragment to 0– In all other fragments, sets to 1

0 0 1 1

Original IP Packet Fragments

Page 9: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 9

Identification FieldIdentification Field IP packet has a 16-bit Identification field

– If router fragments, places the original Identification field value in the Identification field of each fragment

47 47 47 47

Original IP Packet Fragments

Total Length in bytes (16)

Time to Live (8)

Version(4)

Hdr Len(4) TOS (8)

Identification (16 bits) Flags (3) Fragment Offset (13)

Header Checksum (16)Protocol (8)

Page 10: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 10

Identification FieldIdentification Field Purpose

– Allows receiving host’s internet layer process know what fragments belong to each original packet

– Works even if an IP packet is fragmented several times

47 47 47 47

Original IP Packet Fragments

Page 11: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 11

Fragment Offset FieldFragment Offset Field Fragment offset field (13 bits) is used to

reorder fragments with the same Identification field

Contains the data field’s starting point (in octets) from the start of the data field in the original IP packet

Total Length in bytes (16)Version

(4)Hdr Len

(4) TOS (8)

Identification (16 bits) Flags (3) Fragment Offset (13)

Page 12: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 12

Fragment Offset FieldFragment Offset Field Receiving host’s internet layer process

assembles fragments in order of increasing fragment offset field value

This works even if fragments arrive out of order!

Works even if fragmentation occurs multiple times

0212730

Fragment Offset Field

Page 13: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

IP, FragmentationIP, Fragmentation Original header is replicated, other than flags

– Original has no header, so neither will fragments– 20 byte header on each packet

3654 bytes of data– Must fragment into whole number of 8-bytes– Trick to accommodate flags yet specify fragment

length– 1080, 1080, 1080 and 414 bytes of data– Lengths are 20 bytes more in each case– Offset value for first one is zero– Next one? And next? And next?

Page 14: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

TCPTCP A TCP packet is seen to have the following bit

values in the header:– Bits 106 – 111: 000010

Which of the following fields are valid, and which invalid (i.e. the values have no significance) ?– Bytes 0 – 1– Bytes 2 – 3– Bytes 4 – 7– Bytes 8 – 11– Bytes 16 – 17– Bytes 18 – 19

Page 15: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

TCP HeaderTCP Header

Page 16: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

TCP FlagsTCP Flags

16

Flag Description

URG The value of the urgent pointer is valid

ACK The value of the acknowledgment number is valid

PSH Push the data (pass data to receiver as quickly as possible, later)

RST The connection must be reset

SYN Synchronize the sequence numbers during connection establishment

FIN The sender has no more data to transmit

Page 17: Samples of Descriptive Problems CSC/ECE 573, Sections 001 Fall, 2012

Copyright Rudra Dutta, NCSU, Spring, 2005 17

Three-Way HandshakeThree-Way Handshake