Monday, 19 February 2018

OSI Referential Model

Understanding the theory behind networking is really just as important as its actual practical implementation itself. Think of it this way, if you can’t read music, you can’t play a piano! In this section we are going to discuss the OSI (Open Systems Interconnection) Reference Model, and soon you will find out why it contains crucial information about how networks communicate. The OSI Reference Model gives us a theoretical way of describing the process of communication in networks in a step by step process. It was first proposed as a standard reference by the ISO (International Organization for Standardization), and was drafted as a standard in 1983. It is the most idolized guide to understanding networking concepts today, more than any model brought before it.

The OSI model breaks up the process of network communications into 7 layers that consist of various protocols and different technologies that work in tandem from one layer to the next in order to process, and transfer data among computer networks that traverse the internet.

7 Layers of the OSI Model

7: Application Layer

6: Presentation Layer

5: Session Layer

4: Transport Layer

3: Network Layer

2: Data Link Layer

1: Physical Layer

The whole process of network communication consists of various combinations of different protocols and technologies that work together to make networks function, such as TCP/IP (Transmissions Control Protocol/Internet Protocol), network interface cards, and networking media, such as cabling, adapters, and encoding of data for transport. The OSI Model explains the process of how data is converted, encapsulated, transmitted across networks, and decapsulated for processing at the receiving end of a communications media. As data is packaged for delivery across a network media, Information passes from layer to layer in the form of a “Protocol Data Unit” (PDU), in which each layer ads (encapsulates) information in the PDU in the form of headers and footers with the main data or “payload” being encapsulated between these headers and footers (for instance a Microsoft Word document).

Likewise, data is decapsulated at the receiving end of communications after passing across network media and reaching a network interface card. As the PDU travels from layer to layer, say the Application layer (layer 7) down to the Physical layer (layer 1), each layer ads its own header and footer information. This process is reversed on the receiving end, and data is decapsulated as it is passed back up thru each layer starting with layer 1 (the physical layer) on the receiving machine, eventually stripping the data of all of its attached header, trailer, and embedded networking information, and providing raw data for conversion and presentation at the application layer. Each Layer works in tandem with the layer above, and the layer below it to process and transmit data among networks.

Starting with layer 7, the Application Layer provides network access interfaces for email, web, and browser based applications to access network services. In some cases it also provides for error recovery for certain types of applications. HTTP is an Application layer protocol, and the file and printer sharing function of Microsoft based operating systems also work at this level. It also tends to be the first point of network access when GUI’s (Graphical User Interfaces) are used to access network services, such as your browser, or say Remote Desktop Services in Windows based PC’s. HTTP (Hyper Text Transport Protocol) is the protocol we use to connect to websites over the internet.

Layer 6 is the Presentation layer. It provides the formatting functions for data in network communications, such as specifying whether data in a file is encoded as ANSI or UNICODE. It also provides the data formatting for graphics, multi-media, html, and general data files. The presentation layer is responsible for communicating to the application layer how to display, encode, or decode certain files for presentation (say an HTML web page in a browser window.) The protocol data unit at this layer is simply data.

Layer 5: The Session layer is responsible for initiating and managing network connections. It handles the general setup of “sessions”, the exchange of data, and the tear down of sessions upon network communications. Many network security protocols function at this level, SSL being one of those. Login functions for websites, FTP, as well as web and server login interfaces largely work at this layer. It also provides synchronization services, and acts to manage data transmission like a traffic cop, such as determining when each node (computer) can transmit data, when, and for how long. “Keep alive” messages function at this level to maintain idle network connections that may be, or may not be transmitting data, in order to keep network sessions from ending. As well, it manages check points in data transmission so that if a connection is lost or interrupted, only data from the last successful transmission of a PDU needs to be retransmitted, effectively resuming data transfer where it left off (such as with downloading a file from a website within your browser, pausing that download, and resuming it at a later time). The Protocol data unit at this layer is simply data.

Layer 4: The Transport layer breaks down data into separate sets of data (chunks) that are appropriate for the networking medium (such as a particular network interface card). For example, it may break down a 5MB file into 64KB chunks and transmit these chunks as separate sets of data. The protocol data unit at this layer is called a “Segment”, which is the chunk of data which we are transmitting. This layer also handles sequencing of data as it is streamed across network media so that data can be recompiled in the proper order for reconstruction of that data on the receiving end of transmissions.

Layer 3: The Network layer handles routing of network transmissions (data), IP (Internet Protocol) addressing (logical addressing), quality of service, and many network management functions. The protocol data unit at this layer is the “Packet”. Routers work at the network layer by analyzing packets of data being sent and received through its logical ports. For instance ports 80 or 8080 are used for routing data to your web browser specifically. Packets have IP addresses affixed to them, such as 12.45.195.10, this is a public IP address, but there are also private IP addresses that are usually assigned by routers. 192.168.1.0 would be a typical address for a router, then the router would assign a block of IP addresses, say from 192.168.1.1 to 192.168.1.254. You can also access your routers management software directly by entering the routers IP address into any browsers main search bar. In the case of this network, if we were to type in the starting address of 192.168.1.0, this would take us to the routers management software where we could login and access its routing table, quality of service functions such as allowed bandwidth, limiting a number of concurrent connections, etc.

We could also route incoming data to a specific PC on your network by entering the PC’s IP address assigned by the router into its port configuration table and assigning a certain type of incoming data to be routed to that PC by port number. For instance, on my router I could forward all incoming remote desktop and remote assistance data and connections to one PC, such as my laptop by entering 3389 in my port configuration page, and assigning that port to only my laptop’s IP address. In this case, no other PC on my network would be able to initiate a remote desktop, or remote assistance session on my network. Routers add a level of security to networks by hiding your computers private IP address from the public internet, by port addressing, network wireless security protocols, and the integration of advanced firewalls. Besides routers, most switches nowadays work at the network layer.

How do I know what my routers IP address is in order to connect to it?

Well, on a Windows based PC, just click start, run, and type CMD in the run box and hit enter. Now type "ipconfig /all", without the quotes, and hit enter. Scroll to the top and look for the “Default Gateway”, on the right you will see the IP address of your router.

What if I can’t connect to the internet what do I do?

The first thing you should do is to check your PC’s logical connection, regardless if it’s a laptop or desktop PC. If your Desktop is connected by Ethernet, then check that the cable is firmly connected on both ends. Click start, type run, type CMD. Now type ipconfig /all, now look for your IPV4 address. If you see an IP address that starts with 169.254, then you know you are not connected to your router. This doesn’t necessarily mean your network is down, it just means there’s an issue with communication to your router specifically. The 169.254 IP address is what we call a APIPA or “Automatic Private IP Address”. Windows based operating systems automatically assign this type of address when a network interface card (wired or wireless) is unable to make a connection to the network by contacting a DHCP server for internet access. At this point you should check the network and connection indicators on your router. Try resetting your router by unplugging all cables including the power cable for 60 seconds. This will wipe all cached data off the router. Now plug it back in and try to reconnect to the network.

If your internet connection is intermittent, this may indicate a failing router, modem, or bad Ethernet cable. The locking mechanisms on Ethernet cables lose their strength over time and should be replaced yearly, especially in an office setting. Routers and modems are devices that never turn off! They are always on, and so are the subject of constant heat and are subject to oxidation. Oxidation causes the circuits to lose their electrical conductivity, and this is what causes their intermittent shorts (one moment they work, and the next they don’t). It’s best to just replace the router when all else fails. You can also assign static (permanent) IP addresses to computers on an internal network with a router, by filtering addresses based on a specific PC’s MAC address.

Layer 2: The Data Link Layer handles raw data signals entering thru or being sent from a computers network interface card (NIC). NIC drivers operate at this layer. The protocol data unit at this layer is called a frame. The frame trailer consists of a “Frame Check Sequence”. In the frame check sequence exists a CRC or “Cyclical Redundancy Check value, which calculates data using a mathematical function to validate that the data sent is identical to the data received. The CRC is recalculated when data arrives at its destination NIC, and if the values match, the data is believed to be accurate, if not, then the frame or packet is discarded and re-requested from the source. While network interface cards tend to read all frames that enter their interface, the NIC will pass a frame (packet) up through the preceding layers if the address in the frame matches the address of the computer (IP Address) or the address of the network interface card (MAC address). You can set some network interface cards to read all frames that enter its interface by setting the NIC’s frame setting to “Promiscuous Mode”. Not all network interface cards support this.

Layer 1: The Physical Layer handles the actual electrical or optical binary encoding of data that is to be transmitted across a network. This layer operates upon the hardware media that is used for transmission, this includes cabling, connectors, repeaters, hubs, etc. There are many encoding schemes in place today. One way to encode binary data as an example would be to send 1’s as a positive voltage, and 0’s as a negative voltage. Data may also be transmitted as optical light for high bandwidth situations.