More about TCP

Just finished the TCP course from **INE ** : CCIE R&S: Understanding Transmission Control Protocol (TCP) Really recommend this to anyone who is interested in a bit deeper dive of how TCP works, great quality content, **Keith Bogart **is doing amazing job as instructor ! Some TCP facts which I didn’t mentioned in my previous post : Before TCP connection is established TCP goes through the following steps: Closed Initial State Active Open (APP notifies the CPU and requests for service time) - client side Transmission Control Block setup process - CPU creates TCB to keep track of each new TCP connection - for each TCP session we create a new TCB with unique identifier (socket - SRC IP; SRC TCP Port; DST IP; DST TCP Port) Initial sequence number will be random to prevent attacks on TCP When TCB is ready we are sending SYN(x random Seq# number) - this is called a Syn Sent State Receiving Syn(y random seq# number from server) + ACK (seq# x + 1) Sending ACK(seq# y+1) for that TCP Client side state changes to Established This is Active Open - TCB creation process, initiated only per need of client. ...

February 22, 2018 · 4 min

Flow control IEEE 802.3x

In a nutshell, flow control lets a receiver ask its neighbor to stop sending for a short time. Defined in IEEE 802.3 Annex 31B (Wikipedia). The idea itself is old, RFC 59 from 1970 was already arguing about “cease on link” for ARPANET. Some quick facts : receiver buffers get full, it sends a PAUSE frame to the link partner EtherType 0x8808, destination 01:80:C2:00:00:01 pause time in quanta of 512 bit times, 0 means resume one hop only, switches don’t forward PAUSE it stops the whole link, no idea about priorities or QoS Where it’s used : ...

February 21, 2018 · 2 min

TCP congestion control

As we know TCP is called reliable - connection-oriented protocol. But why ? Basically because it keeps the data in its buffer before and after sending it, it makes sure that data was delivered in sequence and receiver send the confirmation about received data (ack). Otherwise data will be re-transmitted there are different ways to re-send the data, let’s explore some of them. So what is happening under the hood of this massive (big overhead comparing to UDP protocol). ...

December 8, 2017 · 4 min

ARP - Address Resolution Protocol

ARP resolves the mapping issue between two different size protocols. It allows to MAP an IP(32 bit) and MAC(48 bit) together. How does it work in a nutshell : Let’s assume that we have two hosts on different networks - A and B, we want them to communicate with each other, what will happen when host A will try reaching the host B for the first time (arp cache empty) : As we can determine by ip and subnet mask combination that host B is on another network , Host A will send a broadcast packet which will contain the following fields : HW : 1 (Ethernet) Protocol : 0x0800 IP HW length : (6) 48 bit Protocol length : (4) 32-bit OPCode : 1 (Request) H/W Source : aa:aa:aa:aa:aa:aa - MAC of host A Protocol source : 192.168.0.2 - IP of host A HW Dest - ff:ff:ff:ff:ff:ff - MAC of broadcast address Protocol dest 192.168.0.1 - **ip of gateway ** Gateway will respond with ARP reply ...

December 8, 2017 · 2 min

Error Detection - Checksum

So how does the checksum works ? Both devices needs to agree on checksum number - will it be odd or even The higher the number is the more precise is the check Let’s take the example from one of YouTube videos with a great explanation of how Checksum is working. Taking the numbers which we want to transmit : 25 11 12 7 13 4 Both devices should agree on checksum - let it be number 16 ...

September 29, 2017 · 2 min

A bit info about ICMP, ping and traceroute

I’ve went through RFC 792 and would like to share some basic (high level) info about ICMP and how we are using it. ICMP is the Internet Control Message Protocol : runs over the network layer, so it’s encapsulated in IP datagrams unreliable, simple datagram service, no retransmission if a message doesn’t reach the destination an ICMP message takes the IP header of the original datagram plus the first 8 bytes of its payload, then gets marked with a type and code. Types and codes are in RFC 792 and the IANA registry host unreachable - the datagram reaches the last router, but that router doesn’t know where the host is port unreachable - the port in the packet isn’t recognized on the receiver’s side How ping uses ICMP : ...

September 28, 2017 · 2 min

The TCP and UDP segment format

Putting this here just for reference as repeating Stanford Networking course. Some of important fields in TCP Segment : Destination port - tells the TCP layer which application should get the bytes on ether end. **Source port **Says where the data should get back, when app starts sending the data it generates unique source port number - to be able to receive the data back. (to differentiate the connection between host A and B) ...

September 22, 2017 · 2 min