CS 453 Computer Networks Lecture 9 Layer 2 – Data Link Layer.

Slides:



Advertisements
Similar presentations
Chapter 3 The Data Link Layer.
Advertisements

Data Link Layer Protocols Flow Control in Data Link Layer.
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
3a. Data Link Layer Protocols
Protocol Strategies.
Assume that a file is transferred from a node A to a node B. The file has been fragmented in 5 frames. Frame 0 is corrupted, the ACK of frame 1 is corrupted,
Data Link Layer Computer Networks.
ICSA341 Data Communications and Computer Networks 1 Data Link Control •General principles.
The Data Link Layer 2 Chapter 3 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Data Link Layer Design Issues Error.
ELEN 602 Lecture 5 Review of last lecture –Error Detection -- parity/CRC etc. Automatic Retransmission Request (ARQ) Reading: Chap
Data Link Layer as a Reliable Data Transport Protocol Computer Networks Computer Networks Term B10.
Data Link Layer Review Advanced Computer Networks.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
CSC 3352 Computer Communications Chapter 3&41 The Link Layer Has 2 main Components The Data Link Layer Medium Access Control (MAC) Examples:SLIP, PPP,
Computer Networks: Data Link Layer 1 Data Link Layer.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 13 Introduction to Computer Networks.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
EEC-484/584 Computer Networks Lecture 9 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
Error Checking continued. Network Layers in Action Each layer in the OSI Model will add header information that pertains to that specific protocol. On.
Data Link Control Line Discipline Flow Control Error Control.
Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)  You saw the need in the most recent assignment.  Data packets.
Data Link Layer We have now discussed the prevalent shared channel technologies  Ethernet/IEEE  Wireless LANs (802.11) We have now covered chapters.
COMT 4291 Performance of Data Communications Protocols General Protocol Concepts.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
Cyclic Code. Linear Block Code Hamming Code is a Linear Block Code. Linear Block Code means that the codeword is generated by multiplying the message.
MODULE I NETWORKING CONCEPTS.
Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
CS 453 Computer Networks Lecture 9 Layer 2 – Data Link Layer.
The data link layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
1 ECE453 – Introduction to Computer Networks Lecture 5 – Data Link Protocols (II)
CS3505: DATA LINK LAYER. data link layer  phys. layer subject to errors; not reliable; and only moves information as bits, which alone are not meaningful.
Error/Flow Control Modeling (ARQ Modeling). © Tallal Elshabrawy 2 Data Link Layer  Data Link Layer provides a service for Network Layer (transfer of.
CS 453 Computer Networks Lecture 11 Layer 2 – Data Link Layer Protocols.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 5 Data Link Layer.
Data Link Layer. Data link layer The communication between two machines that can directly communicate with each other. Basic property – If bit A is sent.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols.
1 The utopia protocol  Unrealistic assumptions: –processing time ignored –infinite buffer space available –simplex: data transmitted in one direction.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
Data Link Layer as a Reliable Data Transport Protocol Advanced Computer Networks Advanced Computer Networks Term D11.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Data Link Layer.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
The Data Link Layer RIS 251 Dr. ir. S.S. Msanjila.
Lab 7 – CSMA/CD (Data Link Layer Layer)
Advanced Computer Networks D12
Chapter 3 Review on Data Link Layer
CMPT 371 Data Communications and Networking
MODULE I NETWORKING CONCEPTS.
Data Link Layer What does it do?
Chapter 3 – Part 1 The Data Link Layer.
Overview Jaringan Komputer (2)
Data Link Layer as a Reliable Data Transport Protocol
CS412 Introduction to Computer Networking & Telecommunication
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
CS4470 Computer Networking Protocols
The Transport Layer Reliability
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
Computer Networks Protocols
Error Checking continued
Presentation transcript:

CS 453 Computer Networks Lecture 9 Layer 2 – Data Link Layer

Data Link Protocols The Data Link Layer is responsible for moving frames of bit, moving frames of bit, via the physical layer, via the physical layer, across the communications medium across the communications medium to a destination machine to a destination machine …not a bit siphon,… these frames of bit don’t just leak across the physical layer and communications medium We need a procedure or protocol to make this happen

Data Link Protocols In order to explore the issue of data link protocols we need to make some assumptions (Some of which we will abandon later)

Data Link Protocols Assumptions Data link layer services the physical layer and the network layer Data link layer services the physical layer and the network layer Although the implementation of the data link layer can vary – sometimes in hardware, sometimes as a software process, we will consider the physical layer, data link layer and the network layer as three independent processes Although the implementation of the data link layer can vary – sometimes in hardware, sometimes as a software process, we will consider the physical layer, data link layer and the network layer as three independent processes Computer A wants to send data to computer B (unidirectional) Computer A wants to send data to computer B (unidirectional) Computer A has a ready supply of data to send Computer A has a ready supply of data to send

Data Link Protocols Assumptions Computers A and B do not crash Computers A and B do not crash So we don’t have to deal with crash recovery Frame transmitted from DLL (Data Link Layer) to DLL is considered pure data to the DLL (excluding its own control information) Frame transmitted from DLL (Data Link Layer) to DLL is considered pure data to the DLL (excluding its own control information) DLL on the sending computer DLL on the sending computer receives a packet from the Network Layer Adds DLL headers/trailer to it Hands it off the physical layer

Data Link Protocols Assumptions DLL on the receiving computer DLL on the receiving computer receives a frame from the physical layer Extracts a packet (payload) from the DLL frame Hands the packet off the physical layer Network layer never sees a frame – only packet Network layer never sees a frame – only packet Data (frames) at DLL level is clean Data (frames) at DLL level is clean We have a suitable set of procedures (functions) to implement the protocol We have a suitable set of procedures (functions) to implement the protocol

Data Link Protocols To implement a very simple simplex DLL protocol Lets look at some definitions (in C) Lets look at some definitions (in C)

Data Link Protocols Basic Definitions From: Tanenbaum (2003) pg. 203

Data Link Protocols Basic Definitions From: Tanenbaum (2003) pg. 203 MAX_PKT 1024 – packet size typedef enum (false, true) boolean; define a boolean data type typedef unsigned int seq_nr – frame sequence number typedef struct{unsigned char data[MAX_PKT];} packet; - define packet as char array typedef enum {data, ack, nak} frame_kind - define a type to classify the type of frame

Data Link Protocols Basic Procedure Definitions From: Tanenbaum (2003) pg. 203

Data Link Protocols Basic Procedure Definitions From: Tanenbaum (2003) pg. 203 wait_for_event(event_type *event) – wait for a network event and return the type of event in event from_network_layer(packet *p) – take a packet from the network layer to_network_layer(packet *p) – send a packet to the network layer from_physical_layer(frame *r) – take a frame from the physical layer, return as r to_physical_layer(frame *s) – send the frame s to the physical layer for transmission

Data Link Protocols Basic Procedure Definitions From: Tanenbaum (2003) pg. 203 start_timer(seq_nr k) – start timer – look for timeout stop_timer(seq_nr k) – stop timer and disable timeout start_ack_timer(void) – start aux timer, enable ack timeouts stop_ack_timer(void) – stop aux timer, disable ack timeouts enable_network_layer(void) – enable the interface to the network layer disable_network_layer(void) – disable the interface to the network layer #define inc(k) if (k<MAX_SEQ) k=k+1; else k=0 -- macro to increment a sequence counter modulo(MAX_SEQ)

Data Link Protocols Simple Simplex DLL Protocol General Logic- receiver - receiver - goes into wait state until a frame_arrival event (only event possible in this simple protocol) On frame_arrival event receiver fetches frame from the physical layer passes packet (frame less frame control header/trailer, etc.) to network layer returns to wait state

Data Link Protocols Simple Simplex DLL Protocol General Logic- sender – sender – fetches a packet from the network layer stores it in frame buffer where it is wrapped with frame header/trailer to make it a frame passes it to the physical layer for transmission returns to first step

Data Link Protocols Simple Simplex DLL Protocol From: Tanenbaum (2003) pg. 203

Data Link Protocols Simple Simplex DLL Protocol Things to note: network layers on both machines always ready network layers on both machines always ready No error or lost data between DLLs on the two machines No error or lost data between DLLs on the two machines No acknowledgements – no sequence numbers No acknowledgements – no sequence numbers No error control – no flow control No error control – no flow control

Data Link Protocol Lets get rid of the assumption that the receiver can process frames to packet and move them to the network layer as fast as the sender can send them.. Not realistic – results in data overruns, lost data We need some form of flow control Clock or rate synchronization possible but not good Us a control frame

Data Link Protocol Simplex with Flow Control from: Tanenbaum (2003) pg. 207

Data Link Protocol Simplex with Flow Control Sender – fetches a packet fetches a packet places the packet in a frame places the packet in a frame sends the frame to the physical layer for transmission sends the frame to the physical layer for transmission then, waits for a control frame from the receiver saying it it OK to send another frame then, waits for a control frame from the receiver saying it it OK to send another frame Receiver – listens for frame arrival event, when it happens listens for frame arrival event, when it happens fetches frame from the physical layer fetches frame from the physical layer extracts packet from frame and send to network layer, and when completed… extracts packet from frame and send to network layer, and when completed… sends control frame to sender to say it is ok to send another frame sends control frame to sender to say it is ok to send another frame from: Tanenbaum (2003) pg. 207

Data Link Protocol Simplex with Flow Control and Error Control from: Tanenbaum (2003) pg. 207

Data Link Protocol Simplex with Flow and Error Control Sender – 1. fetches a packet 2. places the packet in a frame 3. sends the frame to the physical layer for transmission 4. Starts a time-out timer 5. then, waits for a reply frame 6. If the wait event was a frame_arrival, fetch frame from physical layer 7. Check packet in frame for “all clear” acknowledgement, 8. If “all clear” turn off time-out timer Fetch next packet from network layer Increment frame sequence number 9. Go to step 2 from: Tanenbaum (2003) pg. 207

Data Link Protocol Simplex with Flow Control and Error Control from: Tanenbaum (2003) pg. 207

Data Link Protocol Simplex with Flow and Error Control Receiver – Defines expected frame sequence number Defines expected frame sequence number Enters wait state for event Enters wait state for event If event is frame_arrival If event is frame_arrival Fetch frame from physical layer If frame sequence number is what is expected Extract packet from frame and send to network layer Extract packet from frame and send to network layer Increment expected frame counter Increment expected frame counter Create acknowledgement frame Send acknowledgement frame to physical layer – and therefore, back to sender from: Tanenbaum (2003) pg. 207