46
06/14/22 CST 415 - Computer Networks 1 IP CST 415

10/28/2015CST 415 - Computer Networks1 IP CST 415

Embed Size (px)

Citation preview

Page 1: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 1

IP

CST 415

Page 2: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 2

Topics• IP Defined

• Virtual Network

• Internet Datagram

• Datagram Size and Fragmentation

• Time to Live

• Options

Page 3: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 3

Virtual Network• The Internet is an abstraction away from the

physical network.

• The IP layer sits on top the MAC/Physical layers.

• Packets are routed between IP peers.

• It is these IP peers that make up the Internet.

Page 4: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 4

IP Defined

Internet Protocol – Defines unreliable, connectionless delivery of packets.– Unreliable – send it and forget it.

– Connectionless – the route of the packet will be defined “on-the-fly” by the network itself (e.g. routers between the source and destination).

Page 5: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 5

IP Defined

IP Defines:– Basic unit of data transfer (IP Packet)

» Packet Format.» Packet Field meaning

– A routing mechanism for units of data

– Rules for performing unreliable packet delivery.

Page 6: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 6

Internet Datagram

• A Datagram is a unit of data transfer through the MAC/Physical layers.

• A Datagram is encapsulated inside the data packet that is going out the physical layer.

Page 7: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 7

Internet Datagram

The IP datagram will ride along inside the packet in the MAC Client Data field shown above.

Page 8: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 8

Internet Datagram v 4– Format

IP Datagram Format – “Data” is where the IP Client data lies.

Page 9: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 9

Internet DatagramVERS – Version of the IP packet (4 in IPv4 or

6 in IPv6).

HLEN – The length of the Datagram header measured in 32 bit words.

Service Type – Used by routers to determine how and when to deliver a datagram.

Page 10: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 10

Internet DatagramType of Service (Service Type):

Precedence: Datagram precedence from 0 (normal) to 7 (network control packet).

111 - Network Control110 - Internetwork

Control101 - CRITIC/ECP100 - Flash Override011 - Flash010 - Immediate001 - Priority000 - Routine

Page 11: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 11

Internet DatagramType of Service (Service Type):

D - Bit 3: 0 = Normal Delay, 1 = Low Delay.T - Bit 4: 0 = Normal Throughput, 1 = High Throughput.R - Bit 5: 0 = Normal Reliability, 1 = High Reliability. Bit 6-7: Reserved for Future Use.

Page 12: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 12

Internet DatagramType of Service (Service Type): The TOS field may also be interpreted as a “Codepoint”

A Codepoint is a value that will map to some underlying service definition. (e.g.)_____________________________________________________________________ Name Value IIH LSP SNP Status_____________________________________________________________________

Area Addresses 1 y y n ISO 10589 IIS Neighbors 2 n y n ISO 10589 ES Neighbors 3 n y n ISO 10589 IP Intf. Address 132 y y n RFC 1195 Illegal 133 n n n RFC 1195 (not used) Router ID 134 n y n IETF-draft … etc.

Page 13: 10/28/2015CST 415 - Computer Networks1 IP CST 415

Internet DatagramTotal Length:

– Total Length is the length of the datagram, measured in octets, including internet header and data.

– This field allows the length of a datagram to be up to 65,535 octets.

– All hosts must be prepared to accept datagrams of up to 576 octets (whether they arrive whole or in fragments).

– It is recommended that hosts only send datagrams larger than 576 octets if they have assurance that the destination is prepared to accept the larger datagrams.

04/20/23 CST 415 - Computer Networks 13

Page 14: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 14

Internet DatagramIdentification:

An identifying value assigned by the sender IP layer to aid in assembling the fragments of a datagram.

Flags: Various Control Flags.

Bit 0: reserved, must be zeroBit 1: (DF) 0 = May Fragment, 1 = Don't Fragment.Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.

0 1 2 +---+---+---+ | | D | M | | 0 | F | F | +---+---+---+

Page 15: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 15

Internet Datagram

Fragment Offset:– Relevant if the IP layer has actually fragmented

a packet.– This field indicates where in the datagram this

fragment belongs. – The fragment offset is measured in units of 8

octets (64 bits). The first fragment has offset zero.

Page 16: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 16

Internet DatagramTime to Live:

– This field indicates the maximum time the datagram is allowed to remain in the internet system.

– If this field contains the value zero, then the datagram must be destroyed.

– This field is modified in internet header processing. – The time is measured in units of seconds. – Every module that processes a datagram must decrease

the TTL by at least one.– This will cause undeliverable datagrams to be discarded,

and to bound the maximum datagram lifetime.

Page 17: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 17

Internet Datagram

Protocol:

– This field indicates the next level protocol used in the data portion of the internet datagram.

Decimal Keyword Protocol

1 ICMP Internet Control Message

4 IP IP in IP (encasulation)

6 TCP Transmission Control

17 UDP User Datagram

37 DDP Datagram Delivery Protocol

Page 18: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 18

Internet Datagram

Header Checksum: A checksum on the header only.

Source and Destination Address: 4 octets, class A, B, or C IP address.

Page 19: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 19

Internet DatagramOptions

– May or may not be provided.– Must be implemented by all IP

implementations.– There can be a number of variable options.– Options include:

» Security» Route Recording» Stream Identifier (SATNET)» Internet Timestamp» …more on this later

Page 20: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 20

Datagram Size and Fragmentation• The ideal case for datagram transmission:

– The Datagram fits into a single Ethernet frame.– The Ethernet frame remains the same size from source

to destination.» Assumes the physical network type is homogeneous.» Physical packet size must never change.

• Reality of the Internet dictates frame size will be different.– 10BaseT 1514 octets – ATM is 53 octets– The maximum transfer size is called MTU (Maximum Transfer Unit)

Page 21: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 21

Datagram Size and FragmentationWhat would you choose to be a maximum

Ethernet Frame size for optimal transmission?

If your choose the least common size…» You fail to take full advantage of physical media that

will carry large packets.» Your IP layer spends a large amount of time doing

packet fragmentation and reassembly.» What will you do when a new physical layer is

introduced with a smaller packet size?

Page 22: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 22

Datagram Size and FragmentationIf your choose the greatest common size…

» You guarantee that in some physical network segment your packet may be highly fragmented.

» You may adapt a large packet size for a small percentage of your overall network topology.

FDDI is a small percentage of physical network installations but has a packet size of 4470 octets per frame.

» What do you do when a new physical technology is introduced with a larger greatest common size?

Page 23: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 23

Datagram Size and Fragmentation

Reality…– The frame size is chosen based on local physical

media.– This allows for optimal transmission in the local

network.– Fragmentation and re-assembly only needs to be

performed when a packet crosses a physical boundary (e.g. 10BaseT to ATM).

Page 24: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 24

Datagram Size and Fragmentation

•R1 must fragment packets from a potential 1500 octet packet to a 620 octet packet.

•Host B must perform reassembly of 620 octet packets to potential 1500 octet packets.

Page 25: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 25

Datagram Size and Fragmentation

•The initial packet will be fragmented into three frames for transmission over the network shown in the previous slide.

•Fragmentation will happen at R1. Reassembly will occur at Host B.

Page 26: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 26

Datagram Size and FragmentationThree datagram header fields deal with packet

fragmentation:– Identification : A unique identifier used to identify the

original datagram the fragment came from.

– Flags : » Determines if the IP layer will be allowed to fragment the

packet. What happens if a packet needs to be fragmented but is set to

disallow packet fragmentation?

» Determines if this is the last fragment. An unfragmented packet will be the last fragment.

– Fragment Offset : Where in the original packet did this fragment come from?

Page 27: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 27

Datagram Size and Fragmentation

Notation:

FO - Fragment Offset

IHL - Internet Header Length

DF - Don't Fragment flag

MF - More Fragments flag

TL - Total Length

OFO - Old Fragment Offset

OIHL - Old Internet Header

Length

OMF - Old More Fragments flag

OTL - Old Total Length

NFB - Number of Fragment

Blocks

MTU - Maximum Transmission

Unit

Example Fragmentation Procedure:

IF TL =< MTU THEN Submit this datagram to the next step in datagram processing ELSE IF DF = 1 THEN discard the datagram ELSE To produce the first fragment: (1) Copy the original internet header; (2) OIHL <- IHL; OTL <- TL; OFO <- FO; OMF <- MF; (3) NFB <- (MTU-IHL*4)/8; (4) Attach the first NFB*8 data octets; (5) Correct the header: MF <- 1; TL <- (IHL*4)+(NFB*8); Recompute Checksum; (6) Submit this fragment to the next step in datagram processing; To produce the second fragment: (7) Selectively copy the internet header (some options are not copied, see option definitions); (8) Append the remaining data; (9) Correct the header: IHL <- (((OIHL*4)-(length of options not copied))+3)/4; TL <- OTL - NFB*8 - (OIHL-IHL)*4); FO <- OFO + NFB; MF <- OMF; Recompute Checksum; (10) Submit this fragment to the fragmentation test; DONE.

Page 28: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 28

Datagram Size and Fragmentation

Notation:

FO - Fragment Offset

IHL - Internet Header Length

MF - More Fragments flag

TTL - Time To Live

NFB - Number of Fragment

Blocks

TL - Total Length

TDL - Total Data Length

BUFID - Buffer Identifier

RCVBT - Fragment Received Bit

Table

TLB - Timer Lower Bound

Example Reassembly Procedure:

Procedure:

(1) BUFID <- source|destination|protocol|identification; (2) IF FO = 0 AND MF = 0 (3) THEN IF buffer with BUFID is allocated (4) THEN flush all reassembly for this BUFID; (5) Submit datagram to next step; DONE. (6) ELSE IF no buffer with BUFID is allocated (7) THEN allocate reassembly resources with BUFID; TIMER <- TLB; TDL <- 0; (8) put data from fragment into data buffer with BUFID from octet FO*8 to octet (TL-(IHL*4))+FO*8; (9) set RCVBT bits from FO to FO+((TL-(IHL*4)+7)/8); (10) IF MF = 0 THEN TDL <- TL-(IHL*4)+(FO*8) (11) IF FO = 0 THEN put header in header buffer (12) IF TDL # 0 (13) AND all RCVBT bits from 0 to (TDL+7)/8 are set (14) THEN TL <- TDL+(IHL*4) (15) Submit datagram to next step; (16) free all reassembly resources for this BUFID; DONE. (17) TIMER <- MAX(TIMER,TTL); (18) give up until next fragment or timer expires; (19) timer expires: flush all reassembly with this BUFID; DONE.

Page 29: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 29

Time to LiveWhat would be the eventual state of the

Internet if packets were never removed?

Time to Live controls the life time of an individual IP packet.

When Time to Live is 0, the IP layer will remove the packet from the network.

Page 30: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 30

Options• Not required in an IP packet.

• Provides for additional functionality and control.

• Consist of an option code– Possibly followed by a octet length field– Followed by the octets that comprise the option

Page 31: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 31

Options

• Copy– If 1, options will be copied into packet fragments.

– If 0, only the first fragment will have the options.

Page 32: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 32

Options

Page 33: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 33

Options

Page 34: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 34

Options

Record Route:

As the packet traverses the network, record the IP addresses of the routers the packet travels through.

Page 35: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 35

Options

Source Route:

The sender will dictate a route for a packet to take.

Page 36: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 36

Options

Timestamp:

Record the IP address and a timestamp as a packet traverses IP layers in a network.

Page 37: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 37

Internet Datagram IPv6Initially, it was argued (in the early 1990s)

that IPv4 was deficient in the following ways:– Voice and Video streaming– Address space

With the growth in the Internet in early 1990, the number of hosts being added to the Internet doubled every 6-9 months.

Page 38: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 38

Internet Datagram IPv6Since it’s inception, two other standards

entered the IPv4 realm. These were:– NAT : Network Address Translation– CIDR : Classless Inter-Domain Routing

The addition of NAT and CIDR to the TCP/IP protocol suite extended the address expectations until 2028.

Page 39: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 39

Internet Datagram IPv6

The main motivation for changing to IPv4 still remains the eventual exhaustion of the IP address space.

Page 40: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 40

Internet Datagram IPv6

The main consumer of IP addresses is currently Cellular IP and Mobile devices.

Page 41: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 41

Internet Datagram IPv6IPv6 was originally called IPng (IP Next

Generation)

IPv5 was passed over due to may initial mistakes in the standard.

Page 42: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 42

Internet Datagram IPv6IPv6 Provides:

– Larger address space– Extended address hierarchy– Flexible header format– Improved options– Provision for future protocol extension– Support for auto-configuration and renumbering

Page 43: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 43

Internet Datagram v 6 – Format

IP Datagram Format – “Data” is where the IP Client data lies.

VERS PRIO

Hop Limit

Flow Label

Payload Length Next Header

1 byte1 byte 1 byte 1 byte

Source Address (128 bits - 16 bytes)

Dest. Address (128 bits - 16 bytes)

Page 44: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 44

Internet DatagramVERS – Version of the IP packet (6 in IPv6).

Priority – Congestion control in IPv6.

Flow Label - experimental - sender can label a sequence of packets as being in the same flow. Not present in IPv4.

Payload Length: number of bytes in everything following the 40 byte header, or 0 for a Jumbogram.

Page 45: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 45

Internet Datagram• Next Header – Similar to the IPv4

“protocol” field - indicates what type of header follows the IPv6 header.

• Hop Limit – Similar to the IPv4 TTL field (but now it really means hops, not time).

Page 46: 10/28/2015CST 415 - Computer Networks1 IP CST 415

04/20/23 CST 415 - Computer Networks 46

Internet DatagramIPv6 Extension Headers:

– Optional internet-layer information is encoded in separate headers be placed between the IPv6 header and the upper- layer header in a packet.

– There are a small number of such extension headers, each identified by a distinct Next Header value.

– IPv6 packet may carry zero, one, or more extension headers, each identified by the Next Header field of the preceding header.