210 likes | 371 Views
Chapter 3 Review of Protocols And Packet Formats. Outline. Protocol Layering Ethernet IP TCP / IP ARP. Protocol Layering (1 / 2). OSI 7-layers Internet 5-layer. Protocol Layering (2 / 2). Multiple protocols can occur at each layer
E N D
Outline • Protocol Layering • Ethernet • IP • TCP / IP • ARP
Protocol Layering (1 / 2) • OSI 7-layers Internet 5-layer
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
Layer 1 And 2 (Physical And Network Interface) • Two protocols are important • Ethernet • ATM • We will concentrate on Ethernet
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
Ethernet Frame Processing Dest.Address SourceAddress FrameType • 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 Data In Frame Payload Header
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)
Ethernet Addressing (2 / 2) • Broadcast address is all 1s • Single bit determines whether remaining addresses are unicast or multicast multicast bit
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)
IP Datagram Format • Format of each packet sent across Internet • Fixed-size fields make parsing efficient 16 0 4 8 19 24 31
IP Datagram Fields Field Meaning VERS Version number of IP being used (4) HLEN Header length measured in 32-bit units SERVICE Level of service desired TOTAL LENGTH Datagram length in octets including header ID Unique value for this datagram FLAGS Bits to control fragmentation F. OFFSET Position of fragment in original datagram TTL Time to live (hop countdown) TYPE Contents of payload area HDR CHECKSUM One’s-complement checksum over header SOURCE IP address of original sender DESTINATION IP address of ultimate destination IP OPTIONS Special handling parameters PADDING To make options a 32-bit multiple
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
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
UDP Datagram Format 31 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 0 16
TCP Segment Format • Sent end-to-end • Fixed-size fields make parsing efficient 16 10 24 0 4 31
TCP Segment Fields Field Meaning SOURCE PORT ID of sending application DESTINATION PORT ID of receiving application SEQUENCE Sequence number for data in payload ACKNOWLEDGEMENT Acknowledgement of data received HLEN Header length measured in 32-bit units NOT USED Currently unassigned CODE BITS URGENT, ACK, PUSH, RESET, SYN, FIN WINDOW Receiver’s buffer size for additional data CHECKSUM One’s-complement checksum over entire segment URGENT PTR Pointer to urgent data in segment OPTIONS Special handling PADDING To make options a 32-bit multiple
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)
Encapsulation And Transmission • Field in each header specifies type of encapsulated packet
Address Resolution Protocol (ARP) 16 8 24 0 31 • Format when ARP used with Ethernet and IP • Each Ethernet address is six octets • Each IP address is four octets