TCP (Transmission control protocol) makes sure that all data packets transferred by (IP)internet protocol arrives safely.
This is what happens when a node of one network establishes aTCP connection with a node on another network:
1.Physical layer.
It is the lowest layer which defines how the cables,network cards,wireless transmitters and other hardware connect computers to the networks and the networks to the rest of the internet.example of physical layer is Ethernet,WIFI e.t.c.
It provides the means to transfer the actual bits from one computer to another.In an Ethernet network a computer is connected by plugging a network cable in its Ethernet card and then plugging the other end of that cable into a router or switch.
It specifies how bits of data are sent over that cable.
2. Data link layer
The data link layer provides a network connection between hosts on a particular local network.
The internet protocol basically assumes all computers are part of one very large "web" of nodes that can all pass packets to other nodes.there is always route from one node to another,even if sometimes a very large number of intermediate nodes get involved. The data link layer makes this assumption true.
For example the client runs on a personal computer in someones home network which is set up using Ethernet protocol .The data link layer now is that Ethernet protocal. The IP packets that this computer transmits are added as payload to Ethernet packets that are transmitted over the local network to ADSL(Asymmetric digital subscriber line) modem that connects the local network to the provider.
3.Network layer
The network layer is responsible for transmitting and routing data packets over the network.The internet uses the internet protocal (IP) as its network layer.Each node on the network has an addres which is called the ip address of which data is sent as IP packets.
when the client sends its TCP connection request, the network layer puts the request in a number of packets and transmits each of them to the server.each packet can take different route and some packets may get lost along the way.If they all make it the transport layer at the server is able to reconstruct the request and it will prepare response confirming that the TCP connection has been set up.
This response is sent back again in a number of IP packets that will hopefully make it to the client.
4. Transport layer
This layer is realized by two protocals. The first is transmission control protocal(TCP) and the second one is the user datagram protocol(UDP) they both break up a message that an application wants to send into packets to the intended recipient.
At the recipients side,both take the payload from the recieved packets and pass those to the application layer.
Again taking an example of email, the email client and server communicate over a reliable TCP connection.The server listens on a certain port untill a connection request arrives from the client .The server acknowledges the request and aTCP connection is established.Using this connection the client and server can exchange data.
5.MAC address
MAC addres(media access control layer) This layer is responsible for moving data packets to and from one network interface card (NIC) to another accross shared channel.
6. IP address
IP ( internet protocol) it is the the principal protocol in the internet protocol suite for relaying data-grams across network boundaries. its routing function enables inter-networking and essentially establishes the internet.
The IP is responsible for the following:
i) IP addressing
ii)host-to-host communications.
iii)fragmentation
7. TCP port
This is an endpoint to a logical connection and a the way a client program specifies a specific server program on a computer in a network.The port number identifies what type of port it is.
8.Checksum check
Checksum is a small sized datum derived from a digital data for the purpose of detecting errors which may have been introduced during its transmission or storage.
Checksum is a simple type of reduduncy check that is used to detect errors in data.
checksum is created by culculating the binary values in a packet or other block of data using some algorithm and storing the results with the data.
9.Routing table
Routing table is a data table stored in a router or a networked computer that lists the routes to particular network destinations and some cases metrics(distances) associated with those routes.
10. TTL
TTL Time-to-live is an internet protocal that tells a network router whether or not the packet has been in the network too long and should be discarded in IPV6.the TTL in each packet has been renamed (hop) limit.
Hop is one portion of the path between source and destination .Data pass through bridges,routers and gateways as they travel between source and destination.each time packets are passed to the next network device,a hop occurs.