* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Routing
Piggybacking (Internet access) wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
Deep packet inspection wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
Serial digital interface wikipedia , lookup
Computer network wikipedia , lookup
Network tap wikipedia , lookup
Asynchronous Transfer Mode wikipedia , lookup
Airborne Networking wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Routing in delay-tolerant networking wikipedia , lookup
TCP congestion control wikipedia , lookup
Internet protocol suite wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Lecture 6 Overview TCP: Transmission Control Protocol • TCP is an alternative transport layer protocol supported by TCP/IP. • TCP provides: – Connection-oriented – Reliable – Full-duplex – Byte-Stream CPE 401/601 Lecture 6 : TCP/IP model 2 TCP Segment Format 1 byte 1 byte 1 byte 1 byte Source Port Destination Port Sequence Number Request Number (ACK) Control Window Size offset Rsrvd Checksum Urgent Pointer Options (if any) Data CPE 401/601 Lecture 6 : TCP/IP model 3 TCP Segment Format • Sequence Number refers to the first byte of data included in the segment • Request Number (Acknowledgement Number) indicates the byte number of the next data that is expected to be received – All bytes up through this number have been received • Window: tells sender how many bytes it can send before receiver will have to toss it away – due to fixed buffer size CPE 401/601 Lecture 6 : TCP/IP model 4 Control Flags • URG: urgent data included • ACK: this segment is (among other things) an acknowledgement • RST: error - abort the session • SYN: synchronize Sequence Numbers (setup) • FIN: polite connection termination CPE 401/601 Lecture 6 : TCP/IP model 5 TCP Connection Creation Client SYN ISN=X 1 ACK=Y+1 CPE 401/601 Lecture 6 : TCP/IP model time 2 SYN ISN=Y, ACK=X+1 Server 3 6 TCP Data and ACK • Once the connection is established, data can be sent • Each data segment includes a sequence number identifying the first byte in the segment • Each segment (data or empty) includes a request number indicating what data has been received CPE 401/601 Lecture 6 : TCP/IP model 7 TCP Buffers • The TCP layer doesn’t know when the application will ask for any received data – buffers incoming data so it’s ready when application asks for it • Both client and server allocate buffers to hold incoming and outgoing data • Both client and server announce with every ACK how much buffer space remains – Window field in a TCP segment CPE 401/601 Lecture 6 : TCP/IP model 8 Send Buffers • The application gives the TCP layer some data to send • The data is put in a send buffer, where it stays until the data is ACK’d – it has to stay, as it might need to be sent again! • TCP layer won’t accept data from application unless (or until) there is buffer space CPE 401/601 Lecture 6 : TCP/IP model 9 ACKs • A receiver doesn’t have to ACK every segment – it can ACK many segments with a single ACK segment • Each ACK can also contain outgoing data – piggybacking • If a sender doesn’t get an ACK after some time limit (MSL) it resends the data. CPE 401/601 Lecture 6 : TCP/IP model 10 TCP Segment Order • IP delivers TCP segments and IP in not reliable – IP datagrams can be lost or arrive out of order • Most TCP implementations will accept out-oforder segments – if there is room in the buffer • Once the missing segments arrive, a single ACK can be sent for the whole thing TCP/IP model 11 Termination • The TCP layer can send a RST segment that terminates a connection if something is wrong • Usually the application tells TCP to terminate the connection politely with a FIN segment CPE 401/601 Lecture 6 : TCP/IP model 12 Connection Termination App1 FIN SN=X 2 ... ACK=X+1 1 App2 CPE 401/601 Lecture 6 : TCP/IP model FIN SN=Y 3 ACK=Y+1 4 13 TCP TIME_WAIT • Once a TCP connection has been terminated there is some unfinished business: – What if the ACK is lost? • The last FIN will be resent and it must be ACK’d. – What if there are lost or duplicated segments that finally reach the destination after a long delay? • TCP hangs out for a while to handle these situations CPE 401/601 Lecture 6 : TCP/IP model 14 Lecture 7 Routing CPE 401 / 601 Computer Network Systems slides modified from Dave Hollinger slides are are modified from J. Kurose & K. Ross Two Key Network-Layer Functions • forwarding: move packets from router’s input to appropriate router output • routing: determine route taken by packets from source to dest. – routing algorithms • Analogy – routing: process of planning trip from source to destination – forwarding: process of getting through single interchange CPE 401/601 Lecture 7 : Routing 16 routing and forwarding routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 0111 1 3 2 CPE 401/601 Lecture 7 : Routing 17 Connection setup • 3rd important function in some architectures – ATM, frame relay, X.25 • before datagrams flow, two end hosts and intervening routers establish virtual connection – routers get involved • network vs transport layer connection service: – network: between two hosts • may also involve intervening routers in case of VCs – transport: between two processes CPE 401/601 Lecture 7 : Routing 18 Network service model • Q: What service model for channel transporting datagrams from sender to receiver? • Example services for individual datagrams: – guaranteed delivery – guaranteed delivery with less than 40 msec delay • Example services for a flow of datagrams: – in-order datagram delivery – guaranteed minimum bandwidth to flow – restrictions on changes in inter-packet spacing CPE 401/601 Lecture 7 : Routing 19 Network layer service models Network Architecture Internet Service Model Guarantees ? Congestion Bandwidth Loss Order Timing feedback best effort none ATM BR ATM VBR ATM ABR ATM UBR CPE 401/601 Lecture 7 : Routing constant rate guaranteed rate guaranteed minimum none no no no yes yes yes yes yes yes no yes no no (inferred via loss) no congestion no congestion yes no yes no no 20 Connection and connection-less service • Datagram network provides network-layer connectionless service • Virtual Circuit network provides network-layer connection service • analogous to the transport-layer services, but: – service: host-to-host – no choice: network provides one or the other – implementation: in network core CPE 401/601 Lecture 7 : Routing 21 Virtual circuits • src-to-dst path behaves much like telephone circuit – performance-wise – network actions along source-to-dest path • call setup, teardown for each call before data can flow • each packet carries VC identifier – not destination host address • every router on source-dest path maintains “state” for each passing connection • link, router resources (bandwidth, buffers) may be allocated to VC – dedicated resources = predictable service) CPE 401/601 Lecture 7 : Routing 22 VC implementation • A VC consists of: – path from source to destination – VC numbers • one number for each link along path – entries in forwarding tables in routers along path • packet belonging to VC carries VC number – rather than dest address • VC number can be changed on each link – New VC number comes from forwarding table CPE 401/601 Lecture 7 : Routing 23 Forwarding table VC number 22 12 1 3 interface number Forwarding table in northwest router: Incoming interface Incoming VC # 1 2 3 1 … 2 32 12 63 7 97 … Outgoing interface Outgoing VC # 3 1 2 3 22 18 17 87 … … Routers maintain connection state information! CPE 401/601 Lecture 7 : Routing 24 Virtual circuits: signaling protocols • used to setup, maintain teardown VC • used in ATM, frame-relay, X.25 • not used in today’s Internet application transport 5. Data flow begins network 4. Call connected data link 1. Initiate call physical CPE 401/601 Lecture 7 : Routing 6. Receive data application 3. Accept call transport 2. incoming call network data link physical 25 Datagram networks • no call setup at network layer • routers: no state about end-to-end connections – no network-level concept of “connection” • packets forwarded using destination host address – packets between same src-dst pair may take different paths application transport network data link physical 1. Send data CPE 401/601 Lecture 7 : Routing application transport 2. Receive data network data link physical 26 Forwarding table 4 billion possible entries Destination Address Range Link Interface 11001000 00010111 00010000 00000000 through 11001000 00010111 00010111 11111111 0 11001000 00010111 00011000 00000000 through 11001000 00010111 00011000 11111111 1 11001000 00010111 00011001 00000000 through 11001000 00010111 00011111 11111111 2 otherwise CPE 401/601 Lecture 7 : Routing 3 27 Longest prefix matching Prefix Match 11001000 00010111 00010 11001000 00010111 00011000 11001000 00010111 00011 otherwise Link Interface 0 1 2 3 Examples DA: 11001000 00010111 00010110 10100001 Which interface? DA: 11001000 00010111 00011000 10101010 Which interface? Network Layer 4-28 Datagram or VC network: why? • Internet (datagram) – data exchange among computers • “elastic” service, no strict timing requirement – “smart” end systems (computers) • can adapt, perform control, error recovery • simple inside network, complexity at “edge” – many link types • different characteristics • uniform service difficult CPE 401/601 Lecture 7 : Routing 29 Datagram or VC network: why? • ATM (VC) – evolved from telephony – human conversation: • strict timing, reliability requirements • need for guaranteed service – “dumb” end systems • telephones • complexity inside network CPE 401/601 Lecture 7 : Routing 30