The traditional way of connecting two ends of communication, born with the telephone age. In this mode of operation, the two parties will have a circuit of connection private to themselves, without interruption of any other parties. Otherwise, they would hear others' voices on their phones, interference! The data travelling on the line is only their's and no one else is using that line at that time.
This is the mode of data transmission on the internet! In this operation, data is divided into small packets (groups, chunks) and sent out onto the network without specifying any route. the routing is controlled by each routers on the network which will choose the best option at the time and place. Once data packets arrived, they will be assembled back in order for the user. The data travelling on the line could belong to different owners, and the line is for "public" use.
to start with, the sender has the following information and ready to send.
message to send
sender MAC, socket (IP address and port)
recipient MAC, coket (IP and port)
------------------
TCP /UDP will divide the message into k packets
each packet will its own envelope (header) with the sender/recipient information included, plus sequence number, checksum.
then pass the packets to the next layer -IP layer
on to the IP Layer means the packets are on the network , left the sender machine.
the routers of the networks will read the header of the packet and then decide which gateway to send the packet to.
the routing algorithms always try to push the packets into the line which is in the right direction.
then the packets will reach the gateway of the recipient's machine
The packets will be collected, error checked
if error exists, send a signal for resending of the particular packet,
then assemble them according to the sequence number
if any particular packet is missing after a set time interval, a resend-request will be made.
Once everything is in order, the system will pass the received message to the recipient's application (email reader, browser, ftp etc.).
Before sending, the sender will have the recipient's MAC, socket (IP, port), otherwise it will not start dividing.
How does it get those information as the human user usually provides email address or web url alone?
This is done by ARP - address resolution protocol.
"Who is xxx.com" or "who is xxx@xxx.com"
the responsible DNS will respond by saying "xxx is at this IP, this MAC..." (port number is by default agreement - 21 for FTP, 9=80 for http...)
to find out the hops along a path.
each hop is a server that forwarded the message to its destination.
This is achieved by TTL field - each server is required to update the TTL field and hence it is taken advantage.