1 Chapter 3 Review of Protocols And Packet Formats.

21
1 Chapter 3 Review of Protocols And Packet Formats
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    220
  • download

    4

Transcript of 1 Chapter 3 Review of Protocols And Packet Formats.

Page 1: 1 Chapter 3 Review of Protocols And Packet Formats.

1

Chapter 3Review of Protocols And Packet Formats

Page 2: 1 Chapter 3 Review of Protocols And Packet Formats.

2

Outline

Protocol Layering Ethernet IP TCP / IP ARP

Page 3: 1 Chapter 3 Review of Protocols And Packet Formats.

3

Protocol Layering (1 / 2)

OSI 7-layers Internet 5-layer

Application Layer

Presentation Layer

Session Layer

Transport Layer

Network Layer

Data Link Layer

Physical Layer

Application

Transport

Internet

Network Interface

Physical

Page 4: 1 Chapter 3 Review of Protocols And Packet Formats.

4

Protocol Layering (2 / 2)

Multiple protocols can occur at each layer The resulting software is known as a stack Outgoing data must pass down through all layers of

the stack between the application and the physical network

Incoming data must pass up through all layers of the stack

We will learn that optimizing communication among layers is an important aspect of building high-speed networks system

Page 5: 1 Chapter 3 Review of Protocols And Packet Formats.

5

Layer 1 And 2 (Physical And Network Interface)

Two protocols are important– Ethernet– ATM

We will concentrate on Ethernet

Page 6: 1 Chapter 3 Review of Protocols And Packet Formats.

6

Ethernet

Layer 1 standards specify details such as the voltage used on copper wires– Carrier Sense Multiple Access with Collision

Detection (CSMA / CD)

Layer 2 standards specify details such as the format of frames and addresses

Variable-size frames

Page 7: 1 Chapter 3 Review of Protocols And Packet Formats.

7

Ethernet Frame Processing

Dedicated physical layer hardware– Checks and removes preamble and CRC on input– Computes and appends CRC and preamble on output

Layer 2 systems use source, destination and (possibly) type fields

6 6 2 46 - 1500

Dest.Address

SourceAddress

FrameType Data In Frame

Header Payload

Page 8: 1 Chapter 3 Review of Protocols And Packet Formats.

8

Ethernet Addressing (1 / 2)

48-bit addressing Unique address assigned to each station

(NIC) Destination address in each packet can

specify delivery to– A single computer (unicast)– All computers in broadcast domain (broadcast)– Some computers in broadcast domain (multicast)

Page 9: 1 Chapter 3 Review of Protocols And Packet Formats.

9

Ethernet Addressing (2 / 2)

Broadcast address is all 1s Single bit determines whether remaining

addresses are unicast or multicast

x x x x x x x m

x x x x x x x x

x x x x x x x x

x x x x x x x x

x x x x x x x x

x x x x x x x x

multicast bit

Page 10: 1 Chapter 3 Review of Protocols And Packet Formats.

10

Internet Protocols Of Interest

Layer 2– Address Resolution Protocol (ARP)

Layer 3– Internet Protocol (IP)

Layer 4– User Datagram Protocol (UDP)– Transmission Control Protocol (TCP)

Page 11: 1 Chapter 3 Review of Protocols And Packet Formats.

11

IP Datagram Format

Format of each packet sent across Internet Fixed-size fields make parsing efficient

VERS HLEN SERVICE TOTAL LENGTH

ID FLAGS F.OFFSET

TTL TYPE HDR CHECKSUM

SOURCE

DESTINATION

IP OPTION (MAY BE OMITTED) PADDING

BEGINNING OF PAYLOAD

0 4 8 16 19 24 31

Page 12: 1 Chapter 3 Review of Protocols And Packet Formats.

12

IP Datagram Fields

Field MeaningVERS Version number of IP being used (4)HLEN Header length measured in 32-bit unitsSERVICE Level of service desiredTOTAL LENGTH Datagram length in octets including headerID Unique value for this datagramFLAGS Bits to control fragmentationF. OFFSET Position of fragment in original datagramTTL Time to live (hop countdown)TYPE Contents of payload areaHDR CHECKSUM One’s-complement checksum over headerSOURCE IP address of original senderDESTINATION IP address of ultimate destinationIP OPTIONS Special handling parametersPADDING To make options a 32-bit multiple

Page 13: 1 Chapter 3 Review of Protocols And Packet Formats.

13

IP addressing

32-bit Internet address assigned to each computer

Virtual, hardware independent value Prefix identifies network; suffix identifies host Network systems use address mask to

specify boundary between prefix and suffix The address remain unchanged as the

datagram passes across the Internet

Page 14: 1 Chapter 3 Review of Protocols And Packet Formats.

14

Next-Hop Forwarding

Routing table– Found in both hosts and routers– Stores ( destination, mask, next_hop ) tuples

Route lookup– Takes destination address as argument– Finds next hop– Uses longest-prefix match

Page 15: 1 Chapter 3 Review of Protocols And Packet Formats.

15

UDP Datagram Format

Field Meaning

SOURCE PORT ID of sending application

DESTINATION PORT ID of receiving application

MESSAGE LENGTH Length of datagram including the header

CHECKSUM One’s-complement checksum over entire datagram

SOURCE PORT DESTINATION PORT

MESSAGE LENGTH CHECKSUM

BEGINNING OF PAYLOAD

0 16 31

Page 16: 1 Chapter 3 Review of Protocols And Packet Formats.

16

TCP Segment Format

Sent end-to-end Fixed-size fields make parsing efficient

SOURCE PORT DESTINATION PORT

SEQUENCE

ACKNOWLEDGEMENT

HLEN NOT USED CODE BITS WINDOW

CHECKSUM URGENT PRT

OPTIONS (MAY BE OMITTED) PADDING

BEGINNING OF PAYLOAD

0 4 10 16 24 31

Page 17: 1 Chapter 3 Review of Protocols And Packet Formats.

17

TCP Segment Fields

Field MeaningSOURCE PORT ID of sending applicationDESTINATION PORT ID of receiving applicationSEQUENCE Sequence number for data in payloadACKNOWLEDGEMENT Acknowledgement of data receivedHLEN Header length measured in 32-bit unitsNOT USED Currently unassignedCODE BITS URGENT, ACK, PUSH, RESET, SYN, FINWINDOW Receiver’s buffer size for additional dataCHECKSUM One’s-complement checksum over entire segmentURGENT PTR Pointer to urgent data in segmentOPTIONS Special handlingPADDING To make options a 32-bit multiple

Page 18: 1 Chapter 3 Review of Protocols And Packet Formats.

18

Protocol Port Numbers

16-bits values knows as protocol port numbers Each UDP user datagram and each TCP segment carries the

port numbers :– SOURCE PORT– DESTINATION PORT

The port spaces of the two protocols are completely independent

UDP demultiplex packets (each application)

TCP demultiplex packets (each application)

Destination IP Address Destination Port NO.

Destination IP Address Destination Port NO.

Source IP Address Source Port NO.

Page 19: 1 Chapter 3 Review of Protocols And Packet Formats.

19

Encapsulation And Transmission

Field in each header specifies type of encapsulated packet

UDP HEADER UDP PAYLOAD

IP HEADER IP PAYLOAD

ETHERNET HEADER ETHERNET PAYLOAD

Page 20: 1 Chapter 3 Review of Protocols And Packet Formats.

20

Address Resolution Protocol (ARP)

Format when ARP used with Ethernet and IP Each Ethernet address is six octets Each IP address is four octets

ETHERNET ADDRESS TYPE (1) IP ADDRESS TYPE (0800)

ETH ADDRLEN(6) IP ADDRLEN(4) OPERATION

SENDER’S ETH ADDR (first 4 octets)

SENDER’S ETH ADDR (last 2 octets) SENDER’S IP ADDR (first 2 octets)

SENDER’S IP ADDR (last 2 octets) TARGET’S ETH ADDR (first 2 octets)

TARGET’S ETH ADDR (last 4 octets)

TARGET’S IP ADDR (all 4 octets)

0 8 16 24 31

Page 21: 1 Chapter 3 Review of Protocols And Packet Formats.

21

QUESTION?