OSI Model:

1. It is model and contains set of rules which are used for communicate between two network devices.

2. It has 7 layers.

3. Now a days the OSI stack is automatically built into every operating system.

4. Data is encapsulated by different headers when data comes top to bottom layer.

5. Data is decapsulated means removing headers one by one when data goes from bottom to Top layer.

Application Layer: -

  1. any application, web browsers (Crome, Firefox, edge etc) which are being used now days.

  2. interface between users and system.

  3. Renowned protocols are DNS (53), DHCP (68,69), HTTP (443,80), Telnet (23), SSH(22), FTP (20,21), BGP (179) ,SMTP(25), POP (110) etc.

    Port: It is service identifier. Range is 0-65535. Renowned ports are 0-1023.

Presentation layer: -

1. How to represent the data to user / next layer of OSI. Audio (MP3, WAV), Image (PNG,JPG), Txt (ASCII,PDF) , Video (MP4).

2. encryption (no one can read the data) and decryption.

3. Compression (remove unnecessary data/ reduce the size) and decompression.

Session Layer: -

1. It creates, maintains and terminates the session automatically when no communication is happened between sender and receiver. Example: Banking site.

  1. One system can create multiple session at a time but one session can active at a time other session will be hold for specific short time period.

3. Every session has a session ID by which hacker can exploit to hack.

Transport layer: -

1. It provides end to end connection oriented and connection less data delivery.

2. It has two protocols: -

> TCP (Reliable, connection oriented, ensure data transmission by acknowledgement, Port No 6,PDU is segment).Header size can be vary 20 to 60 bytes.

\> UDP (Not reliable, connection less, no assurance about data delivery at other site, Port No 17,PDU is datagram). Header size is 8 bytes. It is used for delay sensitive data like video etc.

3. Raw data (Bytes) received from upper layer continuously, it is called byte streaming.

4. It performs full duplex means sender and receiver both can send data to each other at same time.

5. Performs below following function.

a) Segmentation:

Raw data are divided into smaller parts and add TCP header with each part, it is called segment.

b) Error checking:

It generates cyclic redundancy check (CRC) algorithm for a value which is sent with data to destination site. After receiving, it generates again CRC algorithm for a value which matches with received one value from sender, if both values are matched then data will be accepted by destination.

c) Flow control:

\> Buffering: data stores in buffer when path is available, it has been sent to destination and store in buffer at destination site also. When buffer is full, it sends to upper layer.

\> Windowing: How much data will send to destination without any acknowledgment.

> Sequencing: it is a number which is added with each byte in series manner and while all are reached at destination site, those are rearranged by this number.

d) Response and acknowledgement:

For every data transmission at destination, always send acknowledgement to receiver by adding 1 with sequence number. If sender do not receive acknowledgement after specific time, then it sends again same data to destination.

e) Multiplexing:

Segments are divided into smaller parts if size is big and send to destination. After reaching, these are rearranged in proper manner.

Network layer:

1)It is used for logical IP address which is used within wide area network/ multiple networks to identify each network device. It has two version a) IPV4 (32 bits), b) IPV6(128 bits).

2)IP address has two parts. First one for network ID and 2nd part for host ID.

3)It performs path determination means find best path which is stored in routing table to reach the destination. Protocols are EIGRP, OSPF and BGP etc.

4)It provides connection less data transmission sender to destination.

5)Source and destination IP address never changes during transmission in header.

6)IP address is assigned by administrator to network device. It is not permanent for that device.

7)Error checking is performed.

8)It also provides quality of service for priority data.

9) PDU is called packet which header size can vary 20 to 60 bytes.

> MSS (Maximum segment size): Data size only.

> MTU (Maximum transmission unit) = Data + TCP header + IP header (1500 bytes) = 1460 +20 +20.

10) Fragmentation:

If packet size is large then it divides into smaller part, this process is called fragmentation. These are rearranged by identification number in the proper manner if destination is same.

Data link layer:

1) Mac address: Each network device is identified by MAC address (48 Bits). 1st 24 bits identify manufacturer. Last 24 bits identify network interface controller (NIC). It is permanent and unique for every device.

2) Layer 2 device communicate with each other on basis of MAC address by using MAC table.

3) CSMA/CD(Carrier sense media access/ collision detection) : If multiple hosts are using shared media to communicate each other then one host can send the data at a time other will receive or hold for a while to avoid collision. If another device tries to send the data, then first it will sense the media if it finds busy, it will not send and hold for specific time, then it will check again the media.

4)It provides hop to hop delivery. It can send the data within a single network.

5)PDU is called frame. It is two types:

a) IEEE 802.3 (only for layer 2 protocols like STP, CDP etc).

b) Ethernet (For layer3 protocols)

Work is same for both. Only format is different.

6)It provides error checking.

7) NIC card converts frame into bits stream and placed in physical medium.

8) source and destination Mac address changes within header at every network during transmission.

Physical layer:   

1) it deals with actual data in bits format.

2) Hardware: - Hub,

3) Cables (Coaxial, UTP, Twisted pair, Fiber), connector.

3) Transmission mode : Half and full duplex.

4)Topology.

6) Coverts bits to signal ( analog to digital, digital to analog).