Beruflich Dokumente
Kultur Dokumente
Go
Advanced search
Create a book
Download as PDF
Printable version
Main Page
Recent changes
Manual View source
http://wiki.mikrotik.com/wiki/Manual:Connection_oriented_communication_(TCP/IP)[30/10/2010 18:54:58]
Connection termination
When the data transmission is complete and the host wants to terminate the connection, termination process is initiated. Unlike TCP Connection establishment, which uses three-way handshake, connection termination uses four-way massages. Connection is terminated when both sides have finished the shut down procedure by sending a FIN and receiving an ACK. 1. The host A, who needs to terminate the connection, sends a special message with the FIN (finish) flag, indicating that it has finished sending the data. 2. The host B, who receives the FIN segment, does not terminate the connection but enters into a "passive close" (CLOSE_WAIT) state and sends the ACK for the FIN back to the host A. Now the host B enters into LAST_ACK state. At this point host B will no longer accept data from host A, but can continue transmit data to host A. If host B does not have any data to transmit to the host A it will also terminate the connection by sending FIN segment. 3. When the host A receives the last ACK from the host B, it enters into a (TIME_WAIT) state, and sends an ACK back to the host B. 4. Host B gets the ACK from the host A and closes the connection.
http://wiki.mikrotik.com/wiki/Manual:Connection_oriented_communication_(TCP/IP)[30/10/2010 18:54:58]
Manual:Connection oriented communication (TCP/IP) - MikroTik Wiki maintained. In TCP/IP networks transmission between hosts is handled by TCP protocol. Lets think about what happens when datagrams are sent out faster than receiving device can process. Receiver stores them in memory called a buffer. But since buffer space are not unlimited, when its capacity is exceeded receiver starts to drop the frames. All dropped frames must be retransmitted again which is the reason for low transmission performance. To address this problem, TCP uses flow control protocol. window mechanism is used to control the flow of the data. When connection is established, receiver specifies window field (see, TCP header format, Figure 1.6.) in each TCP frame. Window size represents the amount of received data that receiver is willing to store in the buffer. window size (in bytes) is send together with acknowledgements to the sender. So the size of window controls how much information can be transmitted from one host to another without receiving an acknowledgment. Sender will send only amount of bites specified in window size and then will wait for acknowledgments with updated window size. If the receiving application can process data as quickly as it arrives from the sender, then the receiver will send a positive window advertisement (increase the windows size) with each acknowledgement. It works until sender becomes faster than receiver and incoming data will eventually fill the receiver's buffer, causing the receiver to advertise acknowledgment with a zero window. A sender that receives a zero window advertisement must stop transmit until it receives a positive window. Windowing process is illustrated in Figure 2.2.
The host A starts transmit with window size of 1000, one 1000byte frame is transmitted. Receiver (host B) returns ACK with window size to increase to 2000. The host A receives ACK and transmits two frames (1000 bytes each). After that receiver advertises an initial window size to 2500. Now sender transmits three frames (two containing 1,000 bytes and one containing 500 bytes) and waits for an acknowledgement. The first three segments fill the receiver's buffer faster than the receiving application can process the data, so the advertised window size reaches zero indicating that it is necessary to wait before further transmission is possible. The size of the window and how fast to increase or decrease the window size is available in various TCP congestion avoidance algorithms such as Reno, Vegas, Tahoe etc.
Ethernet networking
CSMA/CD
http://wiki.mikrotik.com/wiki/Manual:Connection_oriented_communication_(TCP/IP)[30/10/2010 18:54:58]
Manual:Connection oriented communication (TCP/IP) - MikroTik Wiki The Ethernet system consists of three basic elements: the physical medium used to carry Ethernet signals between network devices, medium access control system embedded in each Ethernet interface that allow multiple computers to fairly control access to the shared Ethernet channel, Ethernet frame that consists of a standardized set of bits used to carry data over the system. Ethernet network uses Carrier Sense Multiple Access with Collision detection (CSMA/CD) protocol for data transmission. That helps to control and manage access to shared bandwidth when two or more devices want to transmit data at the same time. CSMA/CD is a modification of Carrier Sense Multiple Access. Carrier Sense Multiple Access with Collision Detection is used to improve CSMA performance by terminating transmission as soon as collision is detected, reducing the probability of a second collision on retry. Before we discuss a little more about CSMA/CD we need to understand what is collision, collision domain and network segment. A collision is the result of two devices on the same Ethernet network attempting to transmit data at the same time. The network detects the "collision" of the two transmitted packets and discards both of them. If we have one large network solution is to break it up into smaller networks often called network segmentation. It is done by using devices like routers and switches - each of switch ports create separate network segment which result in separate collision domain. A collision domain is a physical network segment where data packets can "collide" with each other when being sent on a shared medium. Therefore on a hub, only one computer can receive data simultaneously otherwise collision can occur and data will be lost.
Hub (called also repeater) is specified in Physical layer of OSI model because it regenerates only electrical signal and sends out input signal to each of ports. Today hubs do not dominate on the LAN networks and are replaced with switches. Carrier Sense means that a transmitter listens for a carrier (encoded information signal) from another station before attempting to transmit. Multiple Access means that multiple stations send and receive on the one medium. Collision Detection - involves algorithms for checking for collision and advertises about collision with collision response Jam signal. When the sender is ready to send data, it checks continuously if the medium is busy. If the medium becomes idle the sender transmits a frame. Look at the Figure 2.4 bellow where simple example of CSMA/CD is explained.
http://wiki.mikrotik.com/wiki/Manual:Connection_oriented_communication_(TCP/IP)[30/10/2010 18:54:58]
1. Any host on the segment that wants to send data listens what is happening on the physical medium(wire) an is checking whether someone else is not sending data already. 2. Host A and host C on shared network segment sees that nobody else is sending and tries to send frames. 3. Host A and Host C are listening at the same time so both of them will transmit at the same time and collision will occur. Collision results in what we refer to as "noise" - a change in the voltage of the signals in the line (wire). 4. Host A and Host B detect this collision and send out jam signal to tell other hosts not to send data at this time. Both Host A and Host C need to retransmit this data, but we don't want them to send frames simultaneously once again. To avoid this, host A and host B will start a random timer (ms) before attempting to start CSMA/CD process again by listening to the wire. Each computer on Ethernet network operates independently of all other stations on the network.
http://wiki.mikrotik.com/wiki/Manual:Connection_oriented_communication_(TCP/IP)[30/10/2010 18:54:58]
Commands that displays current ARP entries on a PC (linux, DOS) and a MikroTik router (commands might do the same thing, but they syntax may be different): For windows and Unix like machines: arp a displays the list of IP addresses with its corresponding MAC addresses ip arp print same command as arp a but display the ARP table on a MikroTik Router. [Back to Content] Categories: Basic | Manual | IP | Case Studies
Privacy policy / About MikroTik Wiki / Disclaimers / Powered by MediaWiki / Designed by Paul Gu
http://wiki.mikrotik.com/wiki/Manual:Connection_oriented_communication_(TCP/IP)[30/10/2010 18:54:58]