CS/EE 145A Reliable Transmission over Unreliable Channel II Netlab.caltech.edu/course.

Slides:



Advertisements
Similar presentations
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Advertisements

Transmission Control Protocol (TCP)
IS333, Ch. 26: TCP Victor Norman Calvin College 1.
Fundamentals of Computer Networks ECE 478/578 Lecture #20: Transmission Control Protocol Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
UNIT 07 Process – to – Process Delivery: UDP,TCP and SCTP
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
Ch 23 Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007.
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Networking. Protocol Stack Generally speaking, sending an message is equivalent to copying a file from sender to receiver.
Process-to-Process Delivery:
Process-to-Process Delivery:
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
CS/EE 145A Reliable Transmission over Unreliable Channel Netlab.caltech.edu/course.
CS/EE 145A Congestion Control Netlab.caltech.edu/course.
TCP Lecture 13 November 13, TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service.
26-TCP Dr. John P. Abraham Professor UTPA. TCP  Transmission control protocol, another transport layer protocol.  Reliable delivery  Tcp must compensate.
CS332, Ch. 26: TCP Victor Norman Calvin College 1.
3: Transport Layer 3a-1 8: Principles of Reliable Data Transfer Last Modified: 10/15/2015 7:04:07 PM Slides adapted from: J.F Kurose and K.W. Ross,
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Networked & Distributed Systems TCP/IP Transport Layer Protocols UDP and TCP University of Glamorgan.
The Transmission Control Protocol (TCP) Application Services (Telnet, FTP, , WWW) Reliable Stream Transport (TCP) Connectionless Packet Delivery.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
23.1 Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 3 THE DATA LINK LAYER
Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be.
THE DATA LINK LAYER Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2.
Networking Basics CCNA 1 Chapter 11.
TCP OVER ADHOC NETWORK. TCP Basics TCP (Transmission Control Protocol) was designed to provide reliable end-to-end delivery of data over unreliable networks.
ECE 4110 – Internetwork Programming
Transport Protocols.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CS 145A Reliable Communication Netlab.caltech.edu/course.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
1 The Data Link Layer A. S. Tanenbaum Computer Networks W. Stallings Data and Computer Communications Chapter 3.
Computer Networking Lecture 16 – Reliable Transport.
Ch 3. Transport Layer Myungchul Kim
Ch 3. Transport Layer Myungchul Kim
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
5. End-to-end protocols (part 1)
CMPT 371 Data Communications and Networking
Process-to-Process Delivery
TCP.
Introduction of Transport Protocols
TCP - Part I Karim El Defrawy
Transport Layer Unit 5.
Transport Layer Our goals:
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Introduction to Computer Networks
Lecture 21 and 22 5/29/2019.
Computer Networks Protocols
Transport Layer 9/22/2019.
Presentation transcript:

CS/EE 145A Reliable Transmission over Unreliable Channel II Netlab.caltech.edu/course

Reliable Communication over Unreliable Channels Retransmission for Lost Packets: Loss Signals Retransmission for Lost Packets: Loss Signals Sliding-Window Algorithm Sliding-Window Algorithm Protocol State Machine Protocol State Machine Lab 3 Lab 3

Lab 3 How to split a file into packets? How to split a file into packets? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to recover from packets reordering? How to recover from packets reordering? How to recover from loss? How to recover from loss? How to use the bandwidth efficiently? How to use the bandwidth efficiently? How to share the bandwidth fairly? How to share the bandwidth fairly? …

Last class … TCP: Reliable Transmission Guarantee: The packets sent will be received with the same order. File System Stream P1, P2, … ???

This class! TCP: Reliable Transmission Guarantee: The packets sent will be received with the same order. IP: Unreliable Transmission Best Efforts: Packets can be dropped, can be reordered, can be duplicated, can be … Stream P1, P2, … ???

What ’ s the difference? Packets cannot arrive at the same time Packets cannot arrive at the same time The sender and receiver should be able to know the start of the flow and the end of the flow The sender and receiver should be able to know the start of the flow and the end of the flow The receiver has to let the sender know which packet is lost. The receiver has to let the sender know which packet is lost. Even worse … Even worse …

Loss Signals Form: Piggyback vs. Control Packet Form: Piggyback vs. Control Packet Signal: Acknowledgment vs. Negative Acknowledgement Signal: Acknowledgment vs. Negative Acknowledgement Amount of information: one packet vs. multiple packets Amount of information: one packet vs. multiple packets

Piggyback vs. Control Packet Piggyback Piggyback Each packet in the reverse traffic carries control information for the forward traffic. Each packet in the reverse traffic carries control information for the forward traffic. Good for two-way traffic. Good for two-way traffic. Robust Robust Less overhead Less overhead Control Packet Special packets carry control information Usually uses NACK Good for one way traffic May carry more information Less robust or More overhead?

ACK RTT time Source Destination 12W 1 12W data ACKs 12 12W

ACK (Loss Detection by Timeout) Time Out! RTT time Source Destination 12W 12W data ACKs 1 12W

ACK (False Loss) Time Out! RTT time Source Destination 12W 1 12W data ACKs 1 12W

NACK (Loss Detection) time Source Destination 12W data NACK:

NACK (NACK Loss) time Source Destination 12 data NACK: W

Stop & Wait RTT time Source Destination 12W 1 12W data ACKs 12 12W

Sliding Window ~ W packets per RTT ~ W packets per RTT RTT time Source Destination 12W12W12W data ACKs 12W w?

Loss Detection with Sliding Window Duplicate Acknowledgement indicates packet loss? Duplicate Acknowledgement indicates packet loss? RTT time Source Destination 12W 2W 12W ACK=1 12W ACK=w+1

How to start a flow? Three-way handshake for TCP Three-way handshake for TCP Simpler Handshake for one-way traffic: Simpler Handshake for one-way traffic: Add a flag field in packet header for starting signal Add a flag field in packet header for starting signal Anything to be negotiate in your protocol? Anything to be negotiate in your protocol?

How to end a flow? TCP style TCP style Simpler solution for one-way traffic? Simpler solution for one-way traffic? Add a flag field in packet header for ending signal? Add a flag field in packet header for ending signal? Which side should disconnect first? Why? Which side should disconnect first? Why? Does a perfect solution exist? Does a perfect solution exist?

How to design? The concept of protocol state and finite state machine (FSM) Have a clear idea of your design Have a clear idea of your design Follow the transition in state machine during implementation Follow the transition in state machine during implementation Test the implementation according to the transition graph Test the implementation according to the transition graph

State Transition Graph

Basic (FSM): Possible State Set Possible State Set Possible Input Set Possible Input Set Possible Output (Action) Set* Possible Output (Action) Set* State Transition Set: State Transition Set: {(origin_state[i], input[i], output[i], target_state[i])} Initial State Set Initial State Set

Concept of “ State Machine ” Flexible for Extensions: Variables Variables Timers Timers Informal conditions and actions Informal conditions and actions

Implement a State Machine Define protocol state: S Define protocol state: S Translate the transition graph into program: Translate the transition graph into program: If ((S== origin_state[i]) && (Input==input[i])) {Action=output[i]S=target_state[i]}

Test the implementation Design test case according to the transition graph: Design test case according to the transition graph: Is each transition covered by at least one test case? Is each transition covered by at least one test case? Is each action covered by at least one test case? Is each action covered by at least one test case?

States for TCP Connection

Lab 3

Lab 3 - Task Implement a reliable communication protocol over UDP: Implement a reliable communication protocol over UDP: Revise your packet format definition in Lab2 Revise your packet format definition in Lab2 Implement packet retransmission Implement packet retransmission

Lab 3 - Requirements  The implementation is based on UDP.  The implementation is able to send a file from one machine to the other.  The network in the middle is not reliable: The network may drop or duplicated or reorder some packets in the middle  Assumption: A single packet will not be contaminated. (Don ’ t worry about the error inside one packet)

Lab 3 - Details Two programs: “ sender ” and “ receiver ” Two programs: “ sender ” and “ receiver ” Sender should be able to read a file from the local disk, cut it into packets, and send it to the receiver. Sender should be able to read a file from the local disk, cut it into packets, and send it to the receiver. Sender can use a port to listen to the feedback from the receiver. Sender can use a port to listen to the feedback from the receiver. Receiver should be able to listen to a port, get the packets from the sender, and send feedback to the receiver, if necessary. Receiver should be able to listen to a port, get the packets from the sender, and send feedback to the receiver, if necessary. Assumption: Assumption: There is only one sender and one receiver. (All the packets to the sender is from the receiver, and vice versa.) There is only one sender and one receiver. (All the packets to the sender is from the receiver, and vice versa.) is a text file in the local disk is a text file in the local disk

Lab 3 – Details: Sender Format: “ sender ” Format: “ sender ” Port1: the port you are listening to the receiver ’ s feedback Port1: the port you are listening to the receiver ’ s feedback IP: the receiver ’ s IP IP: the receiver ’ s IP Port2: the receiver ’ s port Port2: the receiver ’ s port Filename: The file to be sent Filename: The file to be sent The sender should read from, send the content of the file to, and listen to port1 for feedback from the receiver. The sender should read from, send the content of the file to, and listen to port1 for feedback from the receiver.

Lab 3 – Details: Receiver Format: “ receiver ” Format: “ receiver ” Port1: the port you are listening to the sender ’ s data Port1: the port you are listening to the sender ’ s data IP: the sender ’ s IP IP: the sender ’ s IP Port2: the sender ’ s listening port Port2: the sender ’ s listening port Filename: The file to be saved Filename: The file to be saved The receiver should listen to for data, write the data to and send feedback to (sender) if necessary. The receiver should listen to for data, write the data to and send feedback to (sender) if necessary.

Lab 3 - Possible Problems How to design the packet format? How to design the packet format? What kind of feedback? (ACK/NACK? Control packet / piggyback?) What kind of feedback? (ACK/NACK? Control packet / piggyback?) How to detect loss? (Timeout? Duplicate ACK … ) How to detect loss? (Timeout? Duplicate ACK … ) How to maintain the window (If you use window scheme)? How to maintain the window (If you use window scheme)?

Lab 3 - Tips Re-Use the codes in Lab 1 and Lab 2 Re-Use the codes in Lab 1 and Lab 2 Packet format? Packet format? Packet type? (initial packet, ack packet, terminating packet … ) Packet type? (initial packet, ack packet, terminating packet … ) Packet length? Packet length? Packet sequence number? Packet sequence number? Data area … Data area … Window maintenance Window maintenance How to Test? How to Test?

Lab 3 Due: Nov 21 st (Friday) 23:59:59 Due: Nov 21 st (Friday) 23:59: Grading Grading TA hours: TA hours: Tue / Thu (20:00 – 22:00) JRG 170