data link layer
play

Data Link Layer MAC address Protocol Network Layer address must - PDF document

Overview What is a computer network? CSCE 515: What is the Internet? Computer Network What are the popular network reference Programming model? -- Midterm Review OSI, TCP/IP Wenyuan Xu What is the main responsibilities and


  1. Overview � What is a computer network? CSCE 515: � What is the Internet? Computer Network � What are the popular network reference Programming model? -- Midterm Review � OSI, TCP/IP Wenyuan Xu � What is the main responsibilities and issues for each layer? http://www.cse.sc.edu/~wyxu/csce515f07.html Department of Computer Science and Engineering University of South Carolina CSCE515 – Computer Network Programming – 2007 Fall TCP/IP Layering Architecture Important Summary � Data-Link: communication between machines on the same network. OSI model TCP/ I P model � Network: communication between � A simplified model Application The network layer � machines on possibly different networks. Presentation Application � Hosts drop packets into this layer, layer Session routes towards � Transport: communication between destination- only Transport Transport promise- try my best processes (running on machines on � The transport layer Network Network Reliable/unreliable � possibly different networks). Data link Host to Network byte oriented stream Layer Physical CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall Addresses at Layers � Physical Layer: no address necessary � Data Link Layer – address must specify the host Data Link Layer � MAC address Protocol � Network Layer – address must identify the network � IP address � Transport Layer - address must identify the destination process. � Port # CSCE515 – Computer Network Programming – 2007 Fall

  2. Date Link Layer Functionality Framing � What is the main Functionality of date link layer? � A frame is a group of bits, typically in sequence � Provides reliable transfer of information between two adjacent nodes � Issues: � What is the service provided by data link layer? � Frame creation � Encoding: Convert bits to signals and recover bits from received signals � Frame delineation � Use starting and ending characters (tags) to mark � Framing: decide on a minimum unit for sending bits boundaries of frame � Error detection and /or correction of frames � Parity, CRC � Problem: what if tag characters occur in the date or control portions of the frame � Flow control � ARQ, Sliding WINDOW � Use preamble + packet length CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall Error Control Ethernet - A Real Data-Link Layer � What is header of a typical Ethernet frame? � No physical link is perfect, bits will be corrupted � How is Ethernet connected? � We can either: � What is the address used in Ethernet? � Detect errors and request retransmission � example: 08:00:e4:b1:20 � Or correct errors without retransmission � What is the basic protocol? -- CSMA/CD � Multi-access (shared medium) � Error Detection � many hosts on 1 wire � Parity bits � Carrier sense: � Polynomial codes or checksums � can tell when another host is transmitting � Cyclic Redundancy Check (CRC) � Collision detection: � Given a polynomial code and a message, what is the checksummed message � How can a device detect collision? � Given a checksummed message, can you determine whether � How to avoid two device collide again? there are errors. CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall Transmit Algorithm Collisions � If line is idle… � send immediately � upper bound message size of 1500 bytes � must wait 9.6us between back-to-back frames � If line is busy… � wait until idle and transmit immediately CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall

  3. Ethernet Backoff Algorithm � If collision, � How to detect collision? � jam for 32 bits, then stop transmitting frame IP- Network Layer � minimum frame is 64 bytes (header + 46 bytes of data) WHY? � Choose one slot randomly from 2 k slots, where k is the number of collisions the frame has suffered. � One contention slot length = 2 x end-to-end propagation delay � If 16 backoffs occur, the transmission of the frame is considered a failure. CSCE515 – Computer Network Programming – 2007 Fall IP - Network Layer IP Addresses Regional Network 1 � Provide delivery of packets from � IP addresses are not the same as the underlying one host in the Internet to any data-link (MAC) addresses. WHY? other host in the Internet, even if the hosts are on different networks Backbones � IP addresses are logical addresses (not physical) � Connectionless Delivery (each Regional � 32 bits. datagram is treated individually). Network 2 � Unreliable (delivery is not � Includes a network ID and a host ID. guaranteed). � Fragmentation / Reassembly � When an organization applies for IP address, (based on hardware MTU). they get a network ID. � Routing. � Error detection Regional Network 3 CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall Class A Class A Class A The four for mats of IP Addresses � 128 possible network IDs � 128 possible network IDs � 32 bits long: 129.252.138.8 � over 4 million host IDs per network ID � over 4 million host IDs per network ID What is this IP address? class B? What is this IP address? class B? How many hostIDs How many hostIDs possible? possible? Class Class Class B Class B A A 0 NetID HostID � 16K possible network IDs 10 NetID HostID B B � 64K host IDs per network ID 110 NetID HostID C C Class C Class C � over 2 million possible network IDs 1110 Multicast Address D D � about 256 host IDs per network ID 8 bits 8 bits 8 bits 8 bits CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall

  4. Host and Network Addresses IP Routing � A single network interface is assigned a single IP address called the host address. � A host may have multiple interfaces, and therefore multiple host addresses. � Hosts that share a network all have the same IP network address (the network ID). � Display all network interface on a host Actual routing table contains: destination IP address, IP address of next-hop router, network interface, Flag � ifconfig – a � netstat -i CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall Mapping IP Addresses to/from Hardware IP Routing Addresses � Forwarding: � When each packet arrives, looking up the outgoing line � Address Resolution Protocol to use for it in the routing table � How? � Done on a hop-by-hop basis � Why? � If destination is directly connected or on a shared � When? network, send IP datagram directly to destination � Otherwise send datagram to a default router � Reverse Address Resolution � Routing updates � How? � filling in and updating the routing tables � Why? � When? CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall IP Addresses Subnet Mask � 32-bit value containing “1” bits for network ID and � Subnet Addressing subnet ID, and “0” bits for host ID � To make better use of class A and class B 14 8 8 addresses, divide host ID into subnet ID and B B host ID 10 NetID SubnetID HostID 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 14 16 255.255 .255 .0 10 NetID HostID 0xFFFF FF 00 Class B Class B Example: A and B are class B addresses, using the same subnet mask. 14 8 8 A = 165.230.82.52 10 NetID SubnetID HostID B = 165.230.24.93 Same network? M = 255.255.255.0 Same subnet? CSCE515 – Computer Network Programming – 2007 Fall CSCE515 – Computer Network Programming – 2007 Fall

Recommend


More recommend