ECE 435 Network Engineering Lecture 9

Similar documents
ECE 435 Network Engineering Lecture 9

ECE 435 Network Engineering Lecture 15

ECE 435 Network Engineering Lecture 10

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

TSIN02 - Internetworking

TSIN02 - Internetworking

NWEN 243. Networked Applications. Layer 4 TCP and UDP

User Datagram Protocol

TSIN02 - Internetworking

TSIN02 - Internetworking

Chapter 24. Transport-Layer Protocols

TCP : Fundamentals of Computer Networks Bill Nace

7. TCP 최양희서울대학교컴퓨터공학부

Unit 2.

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Lecture 3: The Transport Layer: UDP and TCP

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Transport Protocols & TCP TCP

Transport Protocols. Raj Jain. Washington University in St. Louis

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

Computer Networking Introduction

CS118 Discussion 1A, Week 4. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m.

CSCD 330 Network Programming

CS 640 Introduction to Computer Networks Spring 2009

CSC 401 Data and Computer Communications Networks

The Transport Layer: TCP & Reliable Data Transfer

Networking Technologies and Applications

Chapter III: Transport Layer

Network Technology 1 5th - Transport Protocol. Mario Lombardo -

10 minutes survey (anonymous)

Programming Assignment 3: Transmission Control Protocol

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

05 Transmission Control Protocol (TCP)

IS370 Data Communications and Computer Networks. Chapter 5 : Transport Layer

ECE 650 Systems Programming & Engineering. Spring 2018

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

Introduction to TCP/IP networking

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Introduction to Networks and the Internet

Internet and Intranet Protocols and Applications

Transmission Control Protocol (TCP)

Mobile Transport Layer Lesson 10 Timeout Freezing, Selective Retransmission, Transaction Oriented TCP and Explicit Notification Methods

Chapter 3 Transport Layer

Chapter 3 Transport Layer

ICS 451: Today's plan. Sliding Window Reliable Transmission Acknowledgements Windows and Bandwidth-Delay Product Retransmission Timers Connections

Transport Layer Marcos Vieira

Chapter 3- parte B outline

Transport Protocols and TCP: Review

TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.

CS457 Transport Protocols. CS 457 Fall 2014

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

TCP (Part 2) Session 10 INST 346 Technologies, Infrastructure and Architecture

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

EEC-682/782 Computer Networks I

Question 1 (6 points) Compare circuit-switching and packet-switching networks based on the following criteria:

COMP 431 Internet Services & Protocols. Transport Layer Protocols & Services Outline. The Transport Layer Reliable data delivery & flow control in TCP

TCP: Flow and Error Control

Transport Layer: outline

Simulation of TCP Layer

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

ECE 435 Network Engineering Lecture 17

Transport Protocols. ISO Defined Types of Network Service: rate and acceptable rate of signaled failures.

Basic Reliable Transport Protocols

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

Sequence Number. Acknowledgment Number. Data

CSCI-GA Operating Systems. Networking. Hubertus Franke

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

User Datagram Protocol (UDP):

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Transport Layer: Outline

ECE697AA Lecture 3. Today s lecture

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Sequence Number. Acknowledgment Number. Checksum. Urgent Pointer plus Sequence Number indicates end of some URGENT data in the packet

ITS323: Introduction to Data Communications

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

CSCI-1680 Transport Layer I Rodrigo Fonseca

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

What is TCP? Transport Layer Protocol

TCP/IP Protocol Suite 1

CSCI-1680 Transport Layer I Rodrigo Fonseca

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Reliable Transport I: Concepts and TCP Protocol

The Transport Layer. Part 1

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

Congestion / Flow Control in TCP

Information Network 1 TCP 1/2

Reliable Transport I: Concepts and TCP Protocol

TCP. 1 Administrivia. Tom Kelliher, CS 325. Apr. 2, Announcements. Assignment. Read From Last Time

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

CSCE 463/612 Networks and Distributed Processing Spring 2017

Transcription:

ECE 435 Network Engineering Lecture 9 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 2 October 2018

Announcements HW#4 was posted, due Thursday 1

HW#3 Review md5sum/encryption, seems to have gone well How to validate PGP key is indeed for who it says? Certificate Authority (costs money) Distributed Web of Trust (key signing party). Compare in person/phone, key fingerprint if not want to send whole thing. e-mail First warning sign says its from a bank, but the return address is from a Florida dental school 2

Also not a bank of mine encrypted and verified from UFL, but sent from videotron.ca cablemodem Virus scanned and SPAM scanned, just sort of barely passed pop from deater.net via fetchmail (this isn t suspicious, it s the sender not receiver you have to look at) LMTP local mail transport. LHLO. No mail queue, says right away whether deliver mail is possible. pdf attached probably had some sort of exploit or phishing document. Didn t open. 3

Note, the attachment being listed as Application does not mean it s an executable For the headers, was looking for MIME as what s going on. Also base64 4

TCP Transmission Control Protocol RFC 793 / 1122 / 1323 Reliable, in-order delivery. Adapts to network congestion Takes data stream, breaks into pieces smaller than 64k (usually 1460 to fit in Ethernet) and sends as IP 5

No guarantees all packets will get there, so need to retransmit if needed. Multiple connections can share same port (i.e. webserver on port 80 can handle multiple simultaneous requests) Point-to-point (can t multicast) Full duplex Byte stream, if program does 4 1024byte writes there s no guarantee the other end sees 4 chunks of 1024, only 4k stream of bytes is guaranteed. 6

PUSH flag can be sent that says not to buffer (For example, if interactive command line) URGENT flag can be sent that says to transmit everything and send a signal on the other side that things are urgent. 7

TCP Header Fixed 20-byte header. Up to 64k-20 in size. Data can be empty. 16-bits 16-bits Source Port Destination Port Sequence Number Acknowledgement Number Length(4) Window Size URG/ACK/PSH/RST/SYN/FIN Checksum Urgent Pointer Options (0-32) Data (optional) 8

TCP Header Format 16-bit source port 16-bit dest port 32-bit sequence number 32-bit ack number next byte expected, not last one received 4-bit header length number of 32-bit chunks (includes header) 6-bit reserved (not used) ECN bits 6 bits of flags 9

U (URGent) also the urgent pointer puts to urgent byte ACK (acknowledge) 1 if ack field valid, otherwise ack field ignored PSH receiver should process the data immediately and not buffer it waiting for more to come in RST (reset) reset a connection because something has gone wrong SYN (synchronize) used to establish connection CONNECTION REQUEST (SYN=1,ACK=0) and CONNECTION ACCEPTED (SYN=1,ACK=1) 10

FIN used to release a connection 16-bit window size Only in ACK, says how many bytes to send back. This can be 0, which means I received everything but I am busy and can t take any more right now (can send another ACK with same number and nonzero window to restart) 16-bit checksum similar to UDP also with pseudo header 16-bit urgent pointer options (32-bit words) we ll discuss these later data 11

TCP Opening Connection Sender SYN SEQ=X Receiver SYN=1 ACK=0 SYN+ACK SEQ=Y, ACK=X+1 ACK SEQ=X+1, ACK=Y+1 Three-way handshake (Tomlinson 1975) Server does LISTEN/ACCEPT to wait for connection. Client issues CONNECT: destination/port/size, etc. CONNECT chooses random initial sequence number (ISN) X 12

Sends SYN(SEQ=X) (SYN=1 ACK=0) with port and sequence number Server receives packet. Checks if listening on that port; if not send back a packet with RST to reject. Otherwise it can accept sends back ACK(X+1) plus SYN(SEQ=Y) with sequence of own Client then responds with the server SYN ACK(Y+1) SEQ=x+1 Connection is established SYN number picked, not to be 0. Originally clock based 13

(random these days?). If machine reboots should wait for maximum lifetime to make sure all close Why do this? What happens with simultaneous connection? 14

Closing connection TCP Closing Connection Although full duplex, almost like two independent oneway connections, released independently one side sends packet with FIN other side sends ACK of FIN, that direction is shut down other direction can keep sending data though at some point other side sends FIN this is ACKed 15

Two army problem? Two generals on opposite side trying to co-ordinate attack. Any message can be intercepted by enemy. So say attack at 9pm but that could be lost. Could require other side to send reply, but that could be lost. You need infinite messages to guarantee it got through. If FIN not ACKed within two packet lifetimes, will close anyway. The other side eventually notices and closes too. 16

TCP State Machine 11 possible states starts in CLOSED LISTEN waiting for a connection SYN-SENT started open, waiting for a returning SYN SYN-RECEIVED waiting for ACK ESTABLISHED open, two-way communication can happen FIN-WAIT-1 application has said it s finished 17

FIN-WAIT-2 the other side agreed to release CLOSE-WAIT waiting for a termination request CLOSING waiting for an ACK of closing request both sides closed at once LAST-ACK waiting for ACK from last closing TIME-WAIT waiting to transition to CLOSED long enough to ensure other side gets last ACK large state diagram 18

Typical Connection seen from Client CLOSED user does connect(), SYN sent (step 1 of handshake) SYN-SENT waits for SYN+ACK, sends ACK (step 3 of handshake) ESTABLISHED sends/receives packets eventually user will close() and send FIN FIN-WAIT-1 FIN sent, waiting for ACK 19

FIN-WAIT-2 one direction closed received ACK of FIN, wait for FIN from other side, respond with ACK TIME-WAIT wait until timeout to ensure all packets done in case ACK got lost CLOSED 20

Typical Connection seen from Server CLOSED waits for listen() LISTEN gets SYN, sends SYN+ACK (step 2 of handshake) SYN-RECVD waits for ACK ESTABLISHED sends/receives FIN comes in from client, sends ACK 21

CLOSE-WAIT, closes itself, sends FIN LAST-ACK gets ACK CLOSED 22

Per-segment error control TCP Reliability checksum, Same as UDP. also covers some fields in IP header to make sure at right place TCP checksum is mandatory Checksum is fairly weak compared to crc32 in Ethernet Per-flow reliability What to do in face of lost packets? Need to notice 23

and retransmit and handle out-of-order Sequence number generated for first blob (octet?), 32-bit number in header Sender tracks sequence of what has been sent, waiting for ACK On getting segment, receiver replies with ACK with number indicating the expected next sequence number, and how much has been received. All data preceding X has been received, next expected sequence number is Y. Send more Selective ACK has received segment indicated by 24

ACK Cumulative ACK all previous data previous to the ACK has been received 25

Ways to Catch Errors Checksum Acknowledgement Time-out Error Correction 26

Comparison: Good Transaction Sender Receiver SEQ=100, Len=50 ACK = 150 SEQ=150, LEN=40 ACK=190 27

Error: Corrupted or Lost Packet SEQ 1401, Len200 bytes, SEQ 1601+200, SEQ 1801+200 Last one corrupted receiver only acks through ACK=1601 Eventually timeout, and sender will retransmit Sender Receiver SEQ=100, Len=50 SEQ=150, LEN=40 ACK = 100 SEQ=100, Len=50 ACK=190 28

Error: Delay or Duplicate Packet Duplicate packet (how can happen? a timeout happens and is resent just before ACK gets in) TCP discards packets with duplicate SEQ Sender Receiver SEQ=100, Len=50 SEQ=100, Len=50 Timeout ACK = 150 29

Error: Out-of-order Packet Out-of-order packet Do not ACK packet until preceding ones make it. For performance can queue up out of order ones so they don t have to be resent Sender Receiver SEQ=100, Len=50 ACK = 100 SEQ=150, LEN=40 ACK=190 SEQ=100, Len=50 30

Error: Lost ACK ACKs cumulative, so if the next packet causes an ACK then it doesn t matter. Otherwise a timeout? Sender Receiver SEQ=100, Len=50 ACK = 150 SEQ=150, LEN=40 ACK=190 31

TCP Timer Management What should the timer value be? Too short, send extra packets, too long and takes long time to notice lost packets. On the fly measures round trip time. (RTT) When send segment, start timer, updates. Various algorithms. Often 2 or 4x Connection Timer send SYN. If no response in time, reset 32

Retransmission Timer retransmit data if no ACK Delayed ACK timer if send a packet, tag an ACK along if timer expires and no outgoing data, have to send stanadlone ACK Persist Timer solve deadlock where window was 0, so waiting, and missed the update that said window was open again. Sends special probe packet. Keep trying every 60s? Keepalive Timer if connection idle for a long time, sends probe to make sure still up 33

FIN WAIT 2 Timer avoid waiting in this state forever if other side crashes TIME WAIT TIMER used in TIME WAIT to give other side time to finish before CLOSE 34