Sunday, July 21, 2013

Understanding OSI Model

Overview of Internetworking Models:

When networks first created, computers could typically communicate only with computers from the same manufacturer. For example, companies ran either a complete DECnet based or an IBM based not both together. In the late 1970s, the Open Systems Interconnection (OSI) reference model was created by the International Organization for Standardization (ISO) to resolve this issue.

The OSI model describes how data and network information are communicated from an application on one computer through the network media to an application on another computer, but this process is too much complicated hence OSI reference model breaks this process into layers. it’s a set of guidelines that application developers can use to create and implement applications that run on a network. It also provides a framework for creating and implementing networking standards, and devices.

Advantages of Reference Models:
Advantages of using the OSI layered model include, but are not limited to, the following:
1-It divides the network communication process into smaller and simpler components.
2-It allows multiple-vendor development through standardization of network components.
3-It allows various types of network hardware and software to communicate.
4-It prevents changes in one layer from affecting other layers.

The OSI has seven different layers, divided into two groups (look figure below). The top three layers define how the applications within the end stations will communicate with each other. The bottom four layers define how data is transmitted end to end.


The OSI reference model has the following seven layers:
A-Application layer (layer 7):
Application layer is acting as an interface between the actual application programs. The OSI application layer is responsible for displaying data and images to the user in a human-recognizable format and to interface with the presentation layer layer below it. Examples of applications that utilize the network are:
  • Telnet
  • FTP
  • Instant Message software ( MSN, Yahoo)
  • Microsoft Windows File Shares
  • Web Browsers (Internet Explorer, Firefox, Google Chrome, Safari etc.)
B-Presentation layer (layer 6):
It presents data to the Application layer and is responsible for data translation and code formatting (for example, EBCDIC to ASCII). By providing translation services, the Presentation layer ensures that data
transferred from the Application layer of one system can be read by the Application layer of another one.
Tasks like data compression, decompression, encryption, and decryption are associated with this layer.

C-Session Layer(layer 5):
The Session layer is responsible for setting up, managing, and terminating sessions between Presentation layer entities. This layer also provides dialog control between devices. It coordinates communication between systems by offering three different modes: simplex, half duplex, and full duplex.

D-Transport Layer(layer 4):
The Transport layer segments and reassembles data into a data stream.  They provide end-to-end data transport services and can establish a logical connection between the sending host and destination host. Some of you are probably familiar with TCP and UDP already. If so, you know that both work at the Transport layer and that TCP is a reliable service and UDP is not.

Some major tasks of Transport layer you should know: 
1-Flow Control
Data integrity is ensured at the Transport layer by maintaining flow control. Flow control prevents a sending host on one side of the connection from overflowing the buffers in the receiving host—an event that can
result in lost data. 
Connection-oriented communications ensure that the following will be achieved:
1-The segments delivered are acknowledged back to the sender upon their reception.
2-Any segments not acknowledged are retransmitted.
3-Segments are sequenced back into their proper order upon arrival at their destination.
4-A manageable data flow is maintained in order to avoid congestion, overloading, and data loss.

In reliable transport operation, The transmitting device first establishes a connection-oriented session with its peer system, which is called three-way handshake. Data is then transferred; when the transfer is finished, a call termination takes place to cut down the virtual circuit.

2-Three-way handshake
1-The first “connection agreement” segment is a request for synchronization.
2-The next segments acknowledge the request and establish connection rules between hosts.
3-The final segment notifies the destination host that the connection agreement has been accepted and Data transfer can now start.

3-Windowing
Ideally, data transmission happens quickly and efficiently as you can imagine so there’s time available after the sender transmits the data segment and before it recieve the acknowledgments from the receiving machine, the sender uses this time gap as an opportunity to transmit more data. The quantity of data segments (in bytes) that the transmitting machine is allowed to send without receiving an acknowledgment for them is called a window.

4-Acknowledgments
Reliable data delivery ensures the integrity of a stream of data sent from one machine to the other .It guarantees that the data won’t be duplicated or lost. This is achieved through something called acknowledgment a technique that requires a receiving machine to communicate with the transmitting source by sending an acknowledgment message back to the sender when it receives data. The sender documents each segment measured in bytes; it then sends and waits for this acknowledgment before sending the next segment round of bytes. When it sends a segment, the transmitting machine starts a timer and retransmits if it expires before an acknowledgment

E-Network Layer(layer 3):
The Network layer manages device addressing, tracks the location of devices on the network, and determines the best path to transfer data.

Do you know how the router works, ok  let me discuss.
1-First, when a packet is received on a router interface.
2-The destination IP address is checked.
3-If the packet isn’t destined for that particular router, it will look up the destination network address in the routing table.
4-If there is entry in routing table router chooses its exit interface, the packet will be sent to that interface to be framed and sent out on the local network.
5-If the router can’t find an entry for the packet’s destination network in the routing table, the router drops the packet.

Two types of packets are used at the Network layer: data and route updates.
Data packets used to transport user data through the internetwork. Protocols used to support data traffic are called routed protocols; examples of routed protocols are IP and IPv6.

Route update packets are used to help build and maintain routing tables on each router. Protocols that send route update packets are called routing protocols; examples are RIP, EIGRP, and OSPF.

F-Data link Layer.(layer 2):
Data Link layer ensure that messages are delivered to the proper device on a LAN using MAC addresses and will convert messages from the Network layer into bits(0,1) for the Physical layer to transmit.The Data Link layer formats the message into pieces, each called a data frame, and adds a header containing the destination and source MAC address.

Data Link layer has two sublayers:
Media Access Control (MAC) 802.3 Defines how packets are placed on the media. Line discipline, error notification (not correction), ordered delivery of frames, and flow control used at this sublayer.

Logical Link Control (LLC) 802.2 Responsible for identifying Network layer protocols and then encapsulating them. The LLC can also provide flow control and sequencing of control bits.

G-Physical Layer(layer 1):
The Physical layer specifies the electrical, mechanical and functional requirements for activating, maintaining, and deactivating a physical link between systems. It sends bits and receives bits. Bits come only in values of 1 or 0.
                                   If there is any query write to us on comment box

2 comments: