Monday, April 29, 2019

2 Computer Networking - Protocols

Network protocol

Protocol - A set of rules that enable effective communication to occur.
Standard - An agreed upon definition of a protocol.
Protocols make it possible for various components of the network to communicate with each other.
Standards make it possible for different manufacturer's network components to work together.

Organisations involved in setting standards for networking are:
1. ANSI
2. IEEE
3. ISO
4. IETF
5. W3C

OSI

Open Systems Interconnection (OSI) model breaks the various aspects of a computer network into 7 distinct layers. These layers are kind of like the layers of an onion - each successive layer envelops the layer beneath it hiding it's details from the layers above.

OSI model is a framework into which various networking standards can fit.
OSI model specifies what aspects of a network's operation can be addressed by various network standards.

Seven layers in all. 1-3 are called lower layers and deal with mechanics of how information is sent from one computer to another over a network. 4-7 are upper layers and deal with how application  software can relate to the network through application programming interfaces.

1. Physical layer: addresses physical characteristics of the network like the type of cables used to connect devices, types of connectors used, how long the cables can be etc.
Devices - Repeater, Hub and NIC
Protocol - Ethernet

2. Data Link Layer: lowest layer at which meaning is assigned to the bits that are transmitted over network. Addresses issues like size of packets, means of addressing each packet so that it's delivered to the recipient, basic error detection and correction etc.
At the Data Link Layer, each device on the network has an address - Media Access Control (MAC), this is hard-wired into every network device by the manufacturer and is unique.
Use ipconfig /all (Physical address is the MAC).
One of the most important functions of the Data Link Layer is to provide a way for packets to be sent safely over the physical media without interference from other nodes attempting to send packets at the same time. Ways to do this are CSMA/CD (good up to a network size of 30, then divide into collision domains) and token passing.
Devices - Bridge (intelligent repeater), Switch
Protocol - Ethernet

3. Network Layer: handles the task of routing network messages from one computer to another. IP is a popular network layer protocol. Network layer provides two important functions - logical addressing and routing.
Logical addresses are created by Network layer protocols. They translate logical addresses to MAC addresses. Logical address consists of 2 parts - 1. Network address 2. Device address
Routing comes into play when one computer on a network wants to send packet to a computer on another network.
A protocol is considered routable if it uses addresses that include a network part and a host part.
Devices - Router
Protocol - IP, IPX

4. Transport Layer: concerned with transportation of information from one computer to another. TCP is a popular transport layer protocol. The main purpose of transport layer is to ensure packets are transported reliably without errors - does this by establishing connections between network devices, acknowledging receipt of packets and resending packets that aren't received or corrupted. Also divides a large packet into smaller packets that can be sent efficiently.
A connectionless protocol is User Datagram Protocol (UDP) - used when efficiency and speed is important and reliability isn't.
Netstat command gives status of TCP and UDP connections. Netstat /N for numeric network addresses.
Devices -
Protocol - TCP, UDP

5. Session Layer: establishes sessions (conversations) between networked devices. A session is an exchange of connection oriented transmissions between 2 network devices. Each transmission is handled by transport layer protocol. Session itself is managed by Session layer. Session layer allows 3 transmission modes - Simplex, half-duplex, full-duplex.
Devices -
Protocol -

6. Presentation Layer: handles how data is represented to applications. e.g. ASCII to EBCDIC conversion. Compress/uncompress data for faster transmission. Encrypt/Decrypt data.
Devices -
Protocol -

7. Application Layer: deals with the techniques that application programs use to communicate with the network. This layer represents the programming interfaces that application programs use to request network services. e.g. DNS, FTP, SMTP, NFS, Telnet etc.
Devices -
Protocols - DNS, FTP, SMTP etc.

Ethernet (IEEE 802.3) is the most popular protocol for Physical and Data Link layer. Ethernet comes in 3 speed versions:
1. Standard Ethernet - 10 Mbps
2. Fast Ethernet - 100 Mbps
3. Gigabit Ethernet - 1000 Mbps


TCP/IP

4 layers:
1. Application layer
2. Transport layer
3. Network layer
4. Network interface layer

TCP isn't used for broadcast, UDP is used for it.
Application layer protocol that uses TCP is HTTP, FTP etc.
Application layer protocol that uses UDP is DNS.

No comments: