Showing posts with label Data Communication and Computer Network. Show all posts
Showing posts with label Data Communication and Computer Network. Show all posts

Tuesday, 20 May 2014

Network Services

Post By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
-------------------------------------------------------

Network Services

Introduction

Computer systems and computerized systems help human beings to work efficiently and explore the unthinkable. When these devices are connected together to form a network, the capabilities are enhanced multi-times. Below mentioned are some basic services which any computer network can offer.

Directory Services

These services are mapping between name and its value, which can be variable value or fixed. This software system help store information, organize them and provides various means of access.
  • ACCOUNTING

    In an organization, lots of users have their user name and password mapped to them. Directory Services provides means of storing these information in cryptic form and make available when requested.
  • AUTHENTICATION & AUTHORIZATION

    User credentials can checked to authenticate a user at the time of login and/or periodically. User accounts can be set into hierarchical structure and their access to resources can be controlled using authorization schemes.
  • DOMAIN NAME SERVICES

    DNS is widely used and one of the essential services on which internet works. This system maps IP addresses to domain names, which are easier to remember and recall than IP addresses. Because network works on IP addresses and humans tend to remember website names, when a website is requested, in the back-end DNS provides website’s IP address which is mapped to its name.

File Services

  • FILE SHARING

    One of the reason which gave birth to networking was file sharing. File sharing enables its users to share their data with other users. User can upload the file to a specific server, which is accessible by all intended users. As an alternative, user can make its file shared on its own computer and provides access to intended users.
  • FILE TRANSFER

    This is an activity to copy or move file from one computer to another computer or to multiple computers, with help of underlying network. Networks enable its user to locate other users in the network and transfer files.

Communication Services

  • EMAIL

    Electronic mail is a communication method and something a computer user cannot live without. This is the bases of today’s internet features. Email system has one or more email servers. All its users are provided with unique IDs. When a user sends email to other user, it is actually transferred between users with help of email server.
  • SOCIAL NETWORKING

    Recent technologies have made technical life social. People, computer savvy, can find other known people or friends, can add them into their own account and can share thoughts, pictures and videos.
  • INTERNET CHAT

    Internet chat provides instant text transfer services between two hosts. Two or more people can communicate with each other user Internet Relay Chat services which is text based. These days, voice chat and video chat are common too.
  • DISCUSSION BOARDS

    Discussion boards provides a mechanism to connect multiple peoples with same interests. It enables its users to put queries, questions, suggestions which can be seen by all other users. Other may respond as well.
  • REMOTE ACCESS

    This service enables user to access their own data lying on their computer, remotely. This feature is known as Remote desktop. This can be done via some remote device, e.g. mobile phone or home computer.

Application Services

  • RESOURCE SHARING

    To use resources efficiently and economically, network provides a mean to share them. This may include Servers, Printers, and Storage Media etc.
  • DATABASES

    This application service is one of the most important one. It stores data and information, processes it and enables its users to retrieve in very efficient way by using queries. Databases help organizations to make decisions based on statistics.
  • WEB SERVICES

    World Wide Web has become the synonym for Internet. It is used to connect to the Internet and access files and information services provided by the internet servers.

Posted By MIrza Abdul Hannan3:33:00 pm

Application Protocols

Post By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
-------------------------------------------------------

Application Protocols

Introduction

There are several protocols which works for users in Application Layer. Application layer protocols can be divided into two categories broadly:
  • Protocols which are used by users; email for example.
  • Protocols which help and support protocols used by users; DNS for example.
Few of Application layer protocols are described below:

Domain Name System

DNS works on Client Server model. It uses UDP protocol for transport layer communication. DNS uses hierarchical domain based naming scheme. The DNS server is configured with FQDN (Fully Qualified Domain Names) and email addresses mapped with their respective Internet Protocol addresses.
A DNS server is requested with FQDN and it responds back with the IP address mapped with it. DNS uses UDP port 53.

Simple Mail Transfer Protocol

SMTP is used to transfer electronic mail from one user to another. This task is done by means of email client software (User Agents) the user is using. User Agents help the user to type and format the email and store it until internet is available. When an email is submitted to send, the sending process is handled by Message Transfer Agent which is normally comes inbuilt in email client software.
Message Transfer Agent uses SMTP to forward the email to another Message Transfer Agent (Server side). While SMTP is used by end user to only send the emails, Servers normally use SMTP to send as well as receive emails. SMTP uses TCP port number 25 and 587.
Client software uses IMAP or POP protocols to receive emails.

File Transfer Protocol

FTP is the most widely used protocol for file transfer over the network. FTP uses TCP/IP for communication and it works on TCP port 21. FTP works on Client/Server Model where a client requests file from Server and server sends requested resource back to the client.
FTP uses out-of-band controlling i.e. FTP uses TCP port 20 for exchanging controlling information and the actual data is sent over TCP port 21.
The client requests the server for a file. When the server receives a request for a file it opens a TCP connection for the client and transfers the file. After the transfer is complete the server closes the connection. For a second file, client requests again and the server open a new TCP connection again.

Post Office Protocol

POP (version 3) is a simple mail retrieval protocol used by User Agents (client email software) to retrieve mails from mail server.
When a client needs to retrieve mails from server it opens a connection with the server on TCP port 110. User can then access his mails and download them to local computer system. POP3 works in two modes. The most common mode (delete mode) is to delete the emails from remote server after they are downloaded to local machines. The second mode (keep mode) does not delete the email from mail server and gives the user an option to access mails later on mail server.

Hyper Text Transfer Protocol

HTTP is the foundation of World Wide Web. Hypertext is well organized documentation system which uses hyperlinks to link to another pages in the text documents. HTTP works on client server model. When a client (user) wants to access any HTTP page on the internet it initiates TCP connection to server on port 80. When the server accepts client request, the client is then authorized to access web pages.
To access web pages a client normally uses web browsers, who are responsible for initiating, maintaining and closing TCP connections. HTTP is a stateless protocol, which means the Server maintains no information about earlier requests by clients.
HTTP versions:
  • HTTP 1.0 uses non persistent HTTP. At most one object can be sent over a single TCP connection.
  • HTTP 1.1 uses persistent HTTP. In this version, multiple objects can be sent over a single TCP connection.

Posted By MIrza Abdul Hannan3:32:00 pm

Client Server Model

Post By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
-------------------------------------------------------

Client Server Model

Introduction

Two remote application process can communicate in mainly two different fashions:
  • Peer-to-peer: Both remote processes are at same level and exchange data using some shared resource.
  • Client-Server: One the remote process acts as Client and requests some resource from another application process acting as Server.
In client-server model, any process can act as Server or Client. This not the machine or size of the machine or its computing power which makes it server but it is the feature of serving request that makes it server.

[Image: Client Server Model]

A system can act as Server and Client simultaneously. That is, one process is acting as Server and another is acting as a client. This may also happen that both client and server processes reside on the same machine.

Communication:

Two processes in client-server model can interact in various ways:
  • Sockets
  • Remote Procedure Calls (RPC)

Sockets:

In this paradigm, the process acting as Server opens a socket using a well-known (or known by client) port and waits until some client request comes. The second process acting as Client also opens a socket but instead of waiting for an incoming request, client process ‘requests first’.

[Image: Socket]

When the request is reached to server, it is served. It can either be an information sharing or resource request.

Remote Procedure Call

This is a mechanism where one process interacts with another by means of procedure calls. One process (client) calls the procedure lying on remote host. The process on remote host is said to be Server. Both processes are allocated stubs. This communication happens in the following way:
  • The client process calls the client stub. It passes all the parameters pertaining to program local to it.
  • All parameters are then packed (marshalling) and a system call is made to send them to other side of the network is made.
  • Kernel sends the data over the network and the other end receives it.
  • The remote host passes data to the server stub where it is unmarshalled.
  • The parameters are passed to the procedure and the procedure is then executed.
  • The result is sent back to the client in the same manner.

Posted By MIrza Abdul Hannan3:30:00 pm

Application Layer Introduction

Post By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
-------------------------------------------------------

Application Layer Introduction

Application layer is the highest most layer in OSI and TCP/IP layered model and. This layer exists in both layered Models because of its significance which is interacting with user and user applications. This layer is for applications which are involved in communication system.
A user may or may not directly interacts with these applications. Application layer is where the actual communication is initiated and reflects. Because this layer is on the top of the layer stack it does not serve any other layers. Application layer takes the help of Transport and all layers below it to communicate or transfer its data to the remote host.
When an application layer protocol wants to communicate with its peer application layer protocol on remote hosts it hands over the data or information to the Transport layer. The transport layer does the rest of the things with help of all layers below it.
[Image: Application Layer]
There’s an ambiguity in understanding Application Layer and its protocol. Not every user application can be put into Application Layer. Only application which interacts with the communication system. For example, a designing software or text-editor cannot be considered as application layer programs.
On the other hand when we use a Web Browser, which is actually using HTTP (Hyper Text Transfer Protocol) to interact with the network. So in this case, HTTP is Application Layer protocol which we take into consideration when we study layered models.
Another example is File Transfer Protocol, which helps a user to transfer a text based or binary file across the network. A user can use this protocol in either GUI based software like FileZilla or CuteFTP and the same user can use FTP in Command Line mode.
So it is not important what software you use, it the protocol which is considered at Application Layer used by that software. DNS is a protocol which helps user application protocols like HTTP to accomplish its work.

Posted By MIrza Abdul Hannan3:30:00 pm

User Datagram Protocol

Post By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
-------------------------------------------------------

User Datagram Protocol

Introduction

UDP is simplest Transport Layer communication protocol available of the TCP/IP protocol suite. It involves minimum amount of communication mechanism. UDP is said to be an unreliable transport protocol but it uses IP services which provides best effort delivery mechanism.
In UDP, the receiver does not generate an acknowledgement of packet received and in turn, the sender does not wait for any acknowledgement of packet sent. This feature makes this unreliable as well as easier on processing.

Requirement:

Why do we need an unreliable protocol to transport data? We deploy UDP where the acknowledgement packets share significant amount of bandwidth with the actual data. Say for example, in Video streaming thousands of packets are forwarded towards its users. Acknowledging all the packets is troublesome and may contain huge amount of bandwidth wastage. The best delivery mechanism of underlying IP protocol ensures best efforts to deliver its packets, but even if some packets in video streaming get lost, the impact is not huge and can be ignored easily. Loss of few packets in video and voice traffic sometime goes unnoticed.

Features:

  • UDP is used when acknowledgement of data does not hold any significance.
  • UDP is good protocol for data flowing in one direction.
  • UDP is simple and suitable for query based communications.
  • UDP is not connection oriented.
  • UDP does not provide congestion control mechanism.
  • UDP does not guarantee ordered delivery of data.
  • UDP is stateless.
  • UDP is suitable protocol for streaming applications such as VoIP, multimedia streaming.

UDP Header:

UDP header is as simple as its function
[Image: UDP Header]
UDP header contains four main parameters:
  • Source Port:  This 16 bits information is used to identify the source port of the packet.
  • Destination Port:  This is also 16 bits information, which is used identify application level service on destination machine.
  • Length:  Length field specifies the entire length of UDP packet (including header). It is 16-bits field and minimum value is 8-byte, i.e. the size of UDP header itself.
  • Checksum:  This field stores the checksum value generated by the sender before sending. IPv4 has this field as optional so when checksum field does not contain any value is made 0 and all its bits are set to zero.

UDP application:

Here are few applications as example, which uses UDP to transmit data:
  • Domain Name Services
  • Simple Network Management Protocol
  • Trivial File Transfer Protocol
  • Routing Information Protocol
  • Kerberos

Posted By MIrza Abdul Hannan3:28:00 pm

Transmission Control Protocol

Post By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
-------------------------------------------------------

Transmission Control Protocol

Introduction

TCP is one of the most important protocols of Internet Protocols suite. It is most widely used protocol for data transmission in communication network such as Internet.

Features

  • TCP is reliable protocol, that is, the receiver sends an acknowledgement back to the sender, of each packet it receives. Sender is now confirmed that packet has been received and can process further packets in its queue.
  • TCP ensures that data has been received in the order it was sent.
  • TCP is connection oriented. TCP requires that connection between two remote points be established before sending actual data.
  • TCP provides error-checking and recovery mechanism.
  • TCP provides end-to-end communication.
  • TCP provides flow control and quality of service.
  • TCP operates in Client/Server point-to-point mode.
  • TCP provides full duplex server, i.e. it can act like receiver and sender.

Header

TCP header at minimum is 20 bytes long and maximum 60 bytes.
[Image: TCP Header]
  • Source Port (16-bits):  Identifies source port of the application process on the sending device.
  • Destination Port (16-bits):  Identifies destination port of the application process on the receiving device.
  • Sequence Number (32-bits):  Sequence number of data bytes of a segment in a session.
  • Acknowledgement Number (32-bits):  When ACK flag is set, this number contains the next sequence number of the data byte expect and works as acknowledgement of the previous data received.
  • Data Offset (4-bits):  This field contains two meaning. First, it tells the size of TCP header (32-bit words) Secondly, it indicates the offset of data in current packet in the whole TCP segment.
  • Reserved (3-bits):  Reserved for future use and all are set zero by default.
  • Flags (1-bit each):
    • NS: Nonce Sum bit is used by Explicit Congestion Notification signaling process.
    • CWR: When a host receives packet with ECE bit set, it sets Congestion Windows Reduced to acknowledge that ECE received.
    • ECE: has two meaning:
      • If SYN bit is clear to 0, then ECE means that the IP packet has its CE (congestion experience) bit set.
      • If SYN bit is set to 1, ECE means that the device is ECT capable
    • URG: indicates that Urgent Pointer field has significant data and should be processed.
    • ACK: indicates that Acknowledgement field has significance. If ACK is cleared to 0, it indicates that packet does not contain any acknowledgement.
    • PSH: when set, it is a request to the receiving station to PUSH data (as soon as it comes) to the receiving application without buffering it.
    • RST: Reset flag has many features:
      • It is used to refuse an incoming connection.
      • It is used to reject a segment.
      • It is used to restart a connection.
    • SYN: this flag is used to set up a connection between hosts.
    • FIN: this flag is used to release a connection and no more data is exchanged thereafter. Because packets with SYN and FIN flags have sequence numbers, they are processed in correct order.
  • Windows Size:  This field is used for flow control between two stations and indicates the amount of buffer (in bytes) the receiver has allocated for a segment, i.e. how much data is the receiver expecting.
  • Checksum:  this field contains the checksum of Header, Data and Pseudo Headers.
  • Urgent Pointer:  Points to the urgent data byte if URG flag is set to 1.
  • Options:  Facilitates additional options which are not covered by the regular header. Option field is always described in 32-bit words. If this field contains data less than 32-bit, padding is used to cover the remaining bits to reach 32-bit boundary.

Addressing:

TCP communication between two remote hosts is done by means of port numbers (Transport Service Access Points). Ports numbers can range from 0 – 65535 which are known as:
  • System Ports (0 – 1023)
  • User Ports ( 1024 – 49151)
  • Private/Dynamic Ports (49152 – 65535)

Connection Management:

TCP communication works in Server/Client model. The client initiates the connection and the server either accept or rejects it. Three-way handshaking is used for connection management.
[Image: Three-way handshake]

ESTABLISHMENT:

Client initiates the connection and sends the segment with a Sequence number. Server acknowledges it back with its own Sequence number and ACK of client’s segment (client’s Sequence number+1). Client after receiving ACK of its segment sends an acknowledgement of Server’s response.

RELEASE:

Either of server and client can send TCP segment with FIN flag set to 1. When the receiving end responds it back by ACKnowledging FIN, that direction of TCP communication is closed and connection is released.

Bandwidth Management:

TCP uses the concept of window size to accommodate the need of Bandwidth management. Window size tells the sender (the remote end), how much data byte segment the receiver (this end) can receive. TCP uses slow start phase by using window size 1 increases the window size exponentially after each successful communication.
For example: Client uses windows size 2 and sends 2 bytes of data. When the acknowledgement of this segment received the windows size is doubled to 4 and next segment will be sent of 4 data bytes. When the acknowledgement of 4-byte data segment is received client sets windows size to 8 and so on.
If an acknowledgement is missed, i.e. data lost in transit network or it receives NACK the window size is reduced to half and slow start phase starts again.

Error Control & Flow Control:

TCP uses port numbers to know what application process it needs to handover the data segment. Along with that it uses sequence numbers to synchronize itself with the remote host. All data segments are sent and received with sequence numbers. The Sender knows which last data segment was received by the Receiver when it gets ACK. The Receiver knows what last segment was sent by the Sender looking at the sequence number of recently received packet.
If the sequence number of a segment recently received does not match with the sequence number the receiver was expecting it is discarded and NACK is sent back. If two segments arrives with same sequence number, the TCP timestamp value is compared to make a decision.

Multiplexing:

The technique to combine two or more data stream in one session is called Multiplexing. When a TCP client initializes a connection with Server, it always refers to a well-defined port number which indicates the application process. The client itself uses a randomly generated port number from private port number pools.
Using TCP Multiplexing, a client can communicate with a number of different application process in a single session. For example, a client requests a web page which in turn contains different type of data (HTTP, SMTP, FTP etc.) the TCP session timeout is increased and the session is kept open for longer time so that the three-way handshake overhead can be avoided.
This enables the client system to receive multiple connection over single virtual connection. These virtual connections are not good for Servers if the timeout is too long.

Congestion Control:

When large amount of data is fed to system which is not capable of handling such amount of data, congestion occurs. TCP controls congestion by means of Window mechanism. TCP sets a window size telling the other end how much data segment to send. TCP may use three algorithms for congestion control:
  • Additive increase, Multiplicative Decrease
  • Slow Start
  • Timeout React

Timer Management:

TCP uses different types of timer to control and management different type of tasks:

KEEP-ALIVE TIMER:

  • This timer is used to check the integrity and validity of a connection.
  • When keep-alive time expires, the host sends a probe to check if the connection still exists.

RETRANSMISSION TIMER:

  • This timer maintains stateful session of data sent.
  • If the acknowledgement of sent data does not receive within the Retransmission time, the data segment is sent again.

PERSIST TIMER:

  • TCP session can be paused by either host by sending Window Size 0.
  • To resume the session a host needs to send Window Size with some larger value.
  • If this segment never reaches the other end, both end may wait for each other for infinite time.
  • When the Persist timer expires, the host re-send its window size to let the other end know.
  • Persist Timer helps avoid deadlocks in communication.

TIMED-WAIT:

  • After releasing a connection, either host waits for a Timed-Wait time to terminate the connection completely.
  • This is in order to make sure that the other end has received the acknowledgement of its connection termination request.
  • Timed-out can be a maximum of 240 seconds (4 minutes).

Crash Recovery:

TCP is very reliable protocol. It provides sequence number to each of byte sent in segment. It provides the feedback mechanism i.e. when a host receives a packet it is bound to ACK that packet having the next sequence number expected (if it is not the last segment).
When a TCP Server crashes mid-way communication and re-starts its process it sends TPDU broadcast to all its hosts. The hosts can then send the lasts data segment which was never unacknowledged and carry onwards.

Posted By MIrza Abdul Hannan3:28:00 pm

Transport Layer Introduction

Post By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
-------------------------------------------------------

Transport Layer Introduction

Introduction

Next Layer in OSI Model is recognized as Transport Layer (Layer-4). All modules and procedures pertaining to transportation of data or data stream categorized into this layer. As all other layers, this layer speaks to its peer Transport layer of the remote host.
Transport layer offers peer-to-peer and end-to-end connection between two processes on remote hosts. Transport layer takes data from upper layer (i.e. Application layer) and then breaks it into smaller size segments numbers each byte and hands over to lower layer (Network Layer) for delivery.

Functions

  • This Layer is the first one which breaks the information data, supplied by Application layer in to smaller units called segments. It numbers every byte in the segment and maintains their accounting.
  • This layer ensures that data must be received in the same sequence in which it was sent.
  • This layer provides end-to-end delivery of data between host which may or may not belong to the same subnet.
  • All server processes intend to communicate over the network are equipped with well-known TSAPs (Transport Service Access Point) also known as port numbers.

End-to-end communication

A process on one host identifies its peer host on remote host by means of Transport Service Access Points, also known as Port numbers. TSAPs (Ports) are very well defined and a process which is trying to communicate with its peer knows this in advance.
[Image: Transport Layer | TSAP]
For example, when a DHCP client wants to communicate with remote DHCP server, it always request on port number 67. When a DNS client wants to communicate with remote DNS server it always requests on port number 53 (UDP).
Two main Transport layer protocols are:
  • Transmission Control Protocol
    Provides reliable communication between two hosts.
  • User Datagram Protocol
    Provides unreliable communication between two hosts.

Posted By MIrza Abdul Hannan3:26:00 pm