Thursday, August 21, 2014

Basics concepts, Protocols and Terminology

Machine on which the server is running is called the host machine.

In some applications, such as messaging services, it is possible for programs on users’ machines to communicate directly with each other in what is called peer-to peer (or P2P ) mode. However, for many applications, this is either not possible or prohibitively costly in terms of the number of simultaneous connections required.

Ports and Sockets
A port is a logical connection to a computer and is identifi ed by a number in the range 1–65535.

Ports are implemented upon all computers attached to a network, but it is only those machines that have server programs running on them for which the network programmer will refer explicitly to port numbers.

Port numbers in the range 1–1023 are normally set aside for the use of specifi ed standard services, often referred to as ‘well-known’ services.

The server needs some way of distinguishing between clients and keeping their dialogues separate from each other. This is achieved via the use of sockets.

When a client wishes to make connection to a server, it will create a socket at its end of the communication link. Upon receiving the client’s initial request (on a particular port number), the server will create a new socket at its end that will be dedicated to communication with that particular client.

Just as one hardware link to a server may be associated with many ports, so too may one port be
associated with many sockets.

The Internet and IP Addresses

The protocol used for such communication is called the Internet Protocol (IP). The Internet (upper-case ‘I’) is the world’s largest IP-based network.

IPV4 address machine addresses in what is called quad notation. This is made up of four eight-bit numbers i.e., numbers in the decimal range 0–255), separated by dots.

IPv6 uses 128-bit addresses, which provide massively more addresses.

URL
<protocol>://<hostname>[:<port>][/<pathname>] [/<fi lename>[#<section>]]

TCP

The Internet is a packet-switched network.

Each packet being handled separately and possibly travelling by a completely different route from that of others.

IP is concerned with the routing of these packets through an internet.

It attaches the IP address of the intended recipient to each packet and then tries to determine the most effi cient route available to get to the ultimate destination (taking damaged routers into account).

However, since packets could still arrive out of sequence, be corrupted or even not arrive at all (without indication to either sender or intended recipient that anything had gone wrong), it was decided to place another protocol layer on top of IP.

This further layer was provided by TCP (Transmission Control Protocol), which allowed each end of a connection to acknowledge receipt of IP packets and/or request re-transmission of lost or corrupted packets.

In addition, TCP allows the packets to be rearranged into their correct sequence at the receiving end.

For the TCP layer, this process involves breaking up the data packets into TCP segments and adding sequence numbers and checksums; for the IP layer, it involves placing the TCP segments into IP packets called datagrams and adding the routing details.

If recalculation of checksums reveals that some of the data has been corrupted or checking of sequence numbers shows that some data has not been received, then the transport layer requests re-transmission of the corrupt/missing data. Otherwise, the transport layer acknowledges receipt of the packets.

TCP provides full duplex transmission, the two ends of the connection may be sending data simultaneously.

UDP

User Datagram Protocol (UDP) is an unreliable protocol, since:

i) it doesn’t guarantee that each packet of data will arrive;
(ii) it doesn’t guarantee that packets will be in the right order.

UDP doesn’t re-send a packet if it fails to arrive or there is some other error and it doesn’t re-assemble packets into the correct sequence at the receiving end.

TCP overhead of providing facilities such as confirmation of receipt and re-transmission of lost or corrupted packets used to mean that UDP was significantly faster than TCP.

No comments:

Post a Comment