logging in or signing up TCP raghut44 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 163 Category: Entertainment License: All Rights Reserved Like it (0) Dislike it (0) Added: February 02, 2011 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Transport Control Protocol: Transport Control Protocol TCPConnection-Oriented Service: Connection-Oriented Service Connection-oriented service has a handshake period During this time, a logical connection is made with the destination node The connection is ‘logical’, since all packets are forwarded individually, just like with UDP Typically, connection-oriented service provides reliability, meaning: Acknowledgements are used to ensure packets arrive Checksums/CRCs are used to ensure data integrityTransport Control Protocol (TCP): Transport Control Protocol (TCP) Like X.25, TCP provides connection-oriented delivery at a high level layer X.25 provides it at the Transport OSI layer TCP provides it at the Transport IP layer Providing connection-oriented delivery at a high level allows TCP to be applied to any network Thus the ability to use TCP/IP over Ethernet, Token Ring, etc. However, providing connection-orientation at a high level means that the network is not necessarily optimized for connection-oriented delivery For example, Ethernet is optimized for connectionless deliveryTCP: TCP The essence of TCP is to provide an apparently continuous stream of data Thus, above the transport layer: Data is not fragmented (into packets) Data is in order Lost packets do not occur Thus, the transport layer (and layers below it) must handle: Segmentation and reassembly (SAR) AcknowledgementsSegmentation vs. Fragmentation: Segmentation vs. Fragmentation Segmentation is basically the same as fragmentation, with a few differences: Fragmentation (IP layer): …only occurs when transmitting a packet whose size is larger than the MTU of the destination network Any router (connecting two different network types) could theoretically fragment packets Fragmentation can almost be considered an emergency practice (what to do when something goes wrong) Segmentation (TCP layer): Occurs for all data streams, to divide the data into packets (above TCP layer data is continuous) Only the source host will segment packets Segmentation is a normal part of TCP’s jobTCP: TCP TCP is a reliable protocol All data sent through TCP is automatically divided into packets Each of these packets is ensured to be sent by requiring the destination acknowledge the packets when they are received The destination, knowing it will eventually receive all messages, only has to reorder those messages into an apparently continuous stream of data flowTCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol TCP abstracts data communication to appear as an apparent stream of flowing data: The source sends data as a stream into the network The destination node receives data from the network in an identical form The data arrives in the same order as it was sent All data sent, arrives (in its proper position) This is known as ‘stream orientation’, a format where the data is oriented in such a way as to appear as a direct stream from source to destination In reality, however, the data is sent as packets (using IP datagrams, for example)TCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol TCP is normally achieved by using buffering Data is collected from the stream (and stored into memory), until a certain amount has been obtained This data is packaged into one or more network packets (e.g. IP datagrams) and sent to the destination using connectionless delivery The destination should send an acknowledgement back to the source If this acknowledgement fails to arrive after a specified length of time, the source will retransmit the packet The destination node buffers the incoming packets into memory, where they can be read (byte by byte)TCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol The TCP/IP service layers do not contain a Presentation layer For this reason, both UDP and TCP require that the applications recognize their own data formats For example, using TCP to connect and send an E-Mail message can be achieved using the existing data format (or language) known as SMTP (Simple Mail Transfer Protocol) Using TCP to connect and request WWW pages can be achieved using HTTP (HyperText Transfer Protocol) These protocols are implemented (generated and recognized) inside the applications themselvesTCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol Since TCP is actually implemented using packets (e.g. IP datagrams), it was possible for TCP to ensure bi-directional communication across its connections Transfer across TCP streams is full duplexConnection Establishment: Connection Establishment TCP uses a three-way handshake to establish a connection This means 3 messages are exchanged before a connection exists The first message (SYN), sent by the machine issuing the ‘active open’ request (A), is a request for connection to the destination (B) The second message (SYN/ACK), both an acknowledgement of the first message as well as a request for connection to A, is sent by B The third message (ACK) is an acknowledgement to B (from A) for the second messageTCP Handshake: TCP Handshake SYN SYN/ACK ACK Transmission of data Connection Establishment (Handshake)TCP Reliability: TCP Reliability TCP provides reliability by requiring recipient nodes to send acknowledgments Acknowledgements are sometimes called ACKs When a packet is received by the destination, an ACK is sent back to the source When the source receives the ACK, it sends the next packet And so on, and so on, …TCP Reliability: TCP Reliability S D Network M M M M M M M A A A A A A A M M M M M M M A ATCP Reliability: TCP Reliability If a packet is sent, and no ACK is received within a certain time, the message will be retransmitted This time is called the ‘timeout’ It is possible that the original packet was received, but the ACK was somehow lost TCP networks treat both situations identically The destination will receive the packet again, ignore it (it already has the data), and acknowledge it again Hopefully this time, the acknowledgement will be receivedTCP Reliability: TCP Reliability S D Network M 1 M 2 M 3 M 4 5 6 7 8 9 10 M M M M M M MTCP Reliability: TCP Reliability If each node waited for acknowledgements without transmitting data, it would involve wasteful delays between packets in a series TCP uses a scheme called the ‘sliding window technique’ to solve this problemSliding Window Technique: Sliding Window Technique The sliding window technique allows a transmitting node to transmit more than one packet without waiting for an ACK Nodes cannot transmit more than S packets beyond the first unacknowledged packet S is known as the window size Thus, transmitting nodes have a ‘window’ of up to S packets, all of which have already been sent Some of these packets may be acknowledged At least the first packet is unacknowledged (but sent) When an ACK is received for the first packet in the window, another packet can be sent The window index can be increased by oneSliding Window Technique: Sliding Window Technique Let’s see an example without a sliding window: Packet size: 4, Data: abcd efgh ijkl mnop SYN SYN/ACK ACK Connection established 1: abcd 2: efgh 3: ijkl 4: mnop ACK: 1 ACK: 2 ACK: 3 …etc… Passage of TimeSliding Window Technique: Sliding Window Technique Let’s see the same example with a sliding window: Packet size: 4, Window size: 3, Data: abcd efgh ijkl mnop SYN SYN/ACK ACK Connection established 1: abcd 2: efgh 3: ijkl 4: mnop ACK: 1 ACK: 2 ACK: 3 ACK: 4 Passage of TimePiggybacked ACKs: Piggybacked ACKs Often two node communicate back and forth When an acknowledgement is to be sent from A to B, as well as a data packet, the ACK can be added to the packet and sent to B as one packet Essentially, only the sequencing number is required to indicate that a message has been received Sequencing numbers are discussed later Rather than send a small packet (ACK) followed by a larger packet (data), the node sends a single larger packet (data with piggybacked acknowledgement)TCP Layers: TCP Layers Application Transport Control Protocol (TCP) Internet Protocol (IP) Network Interface HardwareTCP/UDP Layers: TCP/UDP Layers Application TCP Internet Protocol (IP) Network Interface Hardware UDPTCP Header Information: TCP Header Information As stated previously, TCP is built on top of IP datagrams These datagrams must arrive correctly Therefore, TCP streams are often created using the same information as would be used in the IP datagram header: Address (network and machine portion) Header checksum etc,Ports: Ports Multiple TCP streams can be active on any machine Therefore, ports should be used to represent which stream is which These ports are the same ones used for UDP This makes sense, considering both use IP datagrams for their implementationSockets: Sockets Sockets, to programmers, represent connections to the network In some sense, a socket are associated with a network port on the machine A machine (and even a single program) may have several open sockets at any timeSockets: Sockets In UDP, sockets can be shared: Datagrams from different destinations can be received on the same socket Datagrams can be sent to multiple destinations through the same socket In TCP, sockets can not be shared: TCP sockets (or stream sockets) represent an active connection with the other side Both source and destination must have an active socket open for communication to occurStream Sockets: Stream Sockets With stream sockets, one side must initiate the connection The side that will accept a connection requests a ‘passive open’ with its operating system This indicates that the OS should accept incoming connection requests A port is associated with the passive open, and can be used by the initiating node when requesting the connection The side that initiates a connection requests an ‘active open’ The initiating node requests a connection with a given machine (specified by its address) at a particular port If the machine has a passive open registered at that port, the connection will be accepted, otherwise it will notStream Sockets: Stream Sockets The socket that represents a ‘passive open’: Is called a server socket Represents the willingness to accept connections The socket that represents an ‘active open’: Is called a client socket Represents the act of actually connecting to a server socketData Corruption: Data Corruption TCP uses a 16 octet checksum to ensure that data has not been corrupted If data is changed in any way, the checksum computed using the data at the destination will be different than the checksum computed on the source side (and transmitted along with the data) If checksums do not match: Data is corrupt The checksum is corrupt Both situations are treated identically in TCP, data is retransmittedRetransmission: Retransmission Similar to re-collision avoidance backoff, unacknowledged packets are sent after increasing timeouts This prevents packets from being indefinitely lost because the timeout value is too short for extremely high network usage situations Unless a message is undeliverable, in any amount of time, the message will eventually reach its destination and be acknowledgedConnection Use: Connection Use Once a connection has been made, sequence numbers are used to represent packets that make up the data stream Sequence numbers indicate the position of the data in the packet in the data stream You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
TCP raghut44 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 163 Category: Entertainment License: All Rights Reserved Like it (0) Dislike it (0) Added: February 02, 2011 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Transport Control Protocol: Transport Control Protocol TCPConnection-Oriented Service: Connection-Oriented Service Connection-oriented service has a handshake period During this time, a logical connection is made with the destination node The connection is ‘logical’, since all packets are forwarded individually, just like with UDP Typically, connection-oriented service provides reliability, meaning: Acknowledgements are used to ensure packets arrive Checksums/CRCs are used to ensure data integrityTransport Control Protocol (TCP): Transport Control Protocol (TCP) Like X.25, TCP provides connection-oriented delivery at a high level layer X.25 provides it at the Transport OSI layer TCP provides it at the Transport IP layer Providing connection-oriented delivery at a high level allows TCP to be applied to any network Thus the ability to use TCP/IP over Ethernet, Token Ring, etc. However, providing connection-orientation at a high level means that the network is not necessarily optimized for connection-oriented delivery For example, Ethernet is optimized for connectionless deliveryTCP: TCP The essence of TCP is to provide an apparently continuous stream of data Thus, above the transport layer: Data is not fragmented (into packets) Data is in order Lost packets do not occur Thus, the transport layer (and layers below it) must handle: Segmentation and reassembly (SAR) AcknowledgementsSegmentation vs. Fragmentation: Segmentation vs. Fragmentation Segmentation is basically the same as fragmentation, with a few differences: Fragmentation (IP layer): …only occurs when transmitting a packet whose size is larger than the MTU of the destination network Any router (connecting two different network types) could theoretically fragment packets Fragmentation can almost be considered an emergency practice (what to do when something goes wrong) Segmentation (TCP layer): Occurs for all data streams, to divide the data into packets (above TCP layer data is continuous) Only the source host will segment packets Segmentation is a normal part of TCP’s jobTCP: TCP TCP is a reliable protocol All data sent through TCP is automatically divided into packets Each of these packets is ensured to be sent by requiring the destination acknowledge the packets when they are received The destination, knowing it will eventually receive all messages, only has to reorder those messages into an apparently continuous stream of data flowTCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol TCP abstracts data communication to appear as an apparent stream of flowing data: The source sends data as a stream into the network The destination node receives data from the network in an identical form The data arrives in the same order as it was sent All data sent, arrives (in its proper position) This is known as ‘stream orientation’, a format where the data is oriented in such a way as to appear as a direct stream from source to destination In reality, however, the data is sent as packets (using IP datagrams, for example)TCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol TCP is normally achieved by using buffering Data is collected from the stream (and stored into memory), until a certain amount has been obtained This data is packaged into one or more network packets (e.g. IP datagrams) and sent to the destination using connectionless delivery The destination should send an acknowledgement back to the source If this acknowledgement fails to arrive after a specified length of time, the source will retransmit the packet The destination node buffers the incoming packets into memory, where they can be read (byte by byte)TCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol The TCP/IP service layers do not contain a Presentation layer For this reason, both UDP and TCP require that the applications recognize their own data formats For example, using TCP to connect and send an E-Mail message can be achieved using the existing data format (or language) known as SMTP (Simple Mail Transfer Protocol) Using TCP to connect and request WWW pages can be achieved using HTTP (HyperText Transfer Protocol) These protocols are implemented (generated and recognized) inside the applications themselvesTCP: Stream Delivery Protocol: TCP: Stream Delivery Protocol Since TCP is actually implemented using packets (e.g. IP datagrams), it was possible for TCP to ensure bi-directional communication across its connections Transfer across TCP streams is full duplexConnection Establishment: Connection Establishment TCP uses a three-way handshake to establish a connection This means 3 messages are exchanged before a connection exists The first message (SYN), sent by the machine issuing the ‘active open’ request (A), is a request for connection to the destination (B) The second message (SYN/ACK), both an acknowledgement of the first message as well as a request for connection to A, is sent by B The third message (ACK) is an acknowledgement to B (from A) for the second messageTCP Handshake: TCP Handshake SYN SYN/ACK ACK Transmission of data Connection Establishment (Handshake)TCP Reliability: TCP Reliability TCP provides reliability by requiring recipient nodes to send acknowledgments Acknowledgements are sometimes called ACKs When a packet is received by the destination, an ACK is sent back to the source When the source receives the ACK, it sends the next packet And so on, and so on, …TCP Reliability: TCP Reliability S D Network M M M M M M M A A A A A A A M M M M M M M A ATCP Reliability: TCP Reliability If a packet is sent, and no ACK is received within a certain time, the message will be retransmitted This time is called the ‘timeout’ It is possible that the original packet was received, but the ACK was somehow lost TCP networks treat both situations identically The destination will receive the packet again, ignore it (it already has the data), and acknowledge it again Hopefully this time, the acknowledgement will be receivedTCP Reliability: TCP Reliability S D Network M 1 M 2 M 3 M 4 5 6 7 8 9 10 M M M M M M MTCP Reliability: TCP Reliability If each node waited for acknowledgements without transmitting data, it would involve wasteful delays between packets in a series TCP uses a scheme called the ‘sliding window technique’ to solve this problemSliding Window Technique: Sliding Window Technique The sliding window technique allows a transmitting node to transmit more than one packet without waiting for an ACK Nodes cannot transmit more than S packets beyond the first unacknowledged packet S is known as the window size Thus, transmitting nodes have a ‘window’ of up to S packets, all of which have already been sent Some of these packets may be acknowledged At least the first packet is unacknowledged (but sent) When an ACK is received for the first packet in the window, another packet can be sent The window index can be increased by oneSliding Window Technique: Sliding Window Technique Let’s see an example without a sliding window: Packet size: 4, Data: abcd efgh ijkl mnop SYN SYN/ACK ACK Connection established 1: abcd 2: efgh 3: ijkl 4: mnop ACK: 1 ACK: 2 ACK: 3 …etc… Passage of TimeSliding Window Technique: Sliding Window Technique Let’s see the same example with a sliding window: Packet size: 4, Window size: 3, Data: abcd efgh ijkl mnop SYN SYN/ACK ACK Connection established 1: abcd 2: efgh 3: ijkl 4: mnop ACK: 1 ACK: 2 ACK: 3 ACK: 4 Passage of TimePiggybacked ACKs: Piggybacked ACKs Often two node communicate back and forth When an acknowledgement is to be sent from A to B, as well as a data packet, the ACK can be added to the packet and sent to B as one packet Essentially, only the sequencing number is required to indicate that a message has been received Sequencing numbers are discussed later Rather than send a small packet (ACK) followed by a larger packet (data), the node sends a single larger packet (data with piggybacked acknowledgement)TCP Layers: TCP Layers Application Transport Control Protocol (TCP) Internet Protocol (IP) Network Interface HardwareTCP/UDP Layers: TCP/UDP Layers Application TCP Internet Protocol (IP) Network Interface Hardware UDPTCP Header Information: TCP Header Information As stated previously, TCP is built on top of IP datagrams These datagrams must arrive correctly Therefore, TCP streams are often created using the same information as would be used in the IP datagram header: Address (network and machine portion) Header checksum etc,Ports: Ports Multiple TCP streams can be active on any machine Therefore, ports should be used to represent which stream is which These ports are the same ones used for UDP This makes sense, considering both use IP datagrams for their implementationSockets: Sockets Sockets, to programmers, represent connections to the network In some sense, a socket are associated with a network port on the machine A machine (and even a single program) may have several open sockets at any timeSockets: Sockets In UDP, sockets can be shared: Datagrams from different destinations can be received on the same socket Datagrams can be sent to multiple destinations through the same socket In TCP, sockets can not be shared: TCP sockets (or stream sockets) represent an active connection with the other side Both source and destination must have an active socket open for communication to occurStream Sockets: Stream Sockets With stream sockets, one side must initiate the connection The side that will accept a connection requests a ‘passive open’ with its operating system This indicates that the OS should accept incoming connection requests A port is associated with the passive open, and can be used by the initiating node when requesting the connection The side that initiates a connection requests an ‘active open’ The initiating node requests a connection with a given machine (specified by its address) at a particular port If the machine has a passive open registered at that port, the connection will be accepted, otherwise it will notStream Sockets: Stream Sockets The socket that represents a ‘passive open’: Is called a server socket Represents the willingness to accept connections The socket that represents an ‘active open’: Is called a client socket Represents the act of actually connecting to a server socketData Corruption: Data Corruption TCP uses a 16 octet checksum to ensure that data has not been corrupted If data is changed in any way, the checksum computed using the data at the destination will be different than the checksum computed on the source side (and transmitted along with the data) If checksums do not match: Data is corrupt The checksum is corrupt Both situations are treated identically in TCP, data is retransmittedRetransmission: Retransmission Similar to re-collision avoidance backoff, unacknowledged packets are sent after increasing timeouts This prevents packets from being indefinitely lost because the timeout value is too short for extremely high network usage situations Unless a message is undeliverable, in any amount of time, the message will eventually reach its destination and be acknowledgedConnection Use: Connection Use Once a connection has been made, sequence numbers are used to represent packets that make up the data stream Sequence numbers indicate the position of the data in the packet in the data stream