Bits and Bytes in Computer Networking – Week 5

POTS and Dial-up

POTS is a Plain Old Telephone Service which uses analog transmission signals over the copper wires. This technology lead to the invention of computer networking. Dial-up connections used to POTS to send and receive data. The connections is established by actually dialing the telephone number.

Broadband

Broadband allows us to access internet at home or office and it is comparatively faster than any other network. It as several transmission technologies and they are as follows:

T-Carrier technology

Earlier, each copper wire can transmit call or data only between two client. But with T1 technology, a single copper wire can able to transmit up to 24 data to the client. Further, T3 technology was introduced which can transmit data with 28 X T1

Digital Subscriber Link (DSL)

DSL is similar to T-carrier technology, expect DSL can transmit call and data simultaneously. As Dial-up connections used modem to send and receive data, DSL used DSLAM(Digital Subscriber Link Access Multiplexer) to send and receive data. DSL has two most commonly used type.

ADSL (Asymmetric DSL) – When a client connected to network, the upload speed will be slow and download speed will be fast. This can be used in cases like when client requests data and need more speed to download it.

SDSL (Symmetric DSL) – In this type, upload and download speed are same, these are commonly used in business

HDSL (High bit-rate DSL) – This types is the improvement of there technologies and can transmit data with a speed up to 1.544 Mbps.

Cable Broadband

Cable connections are commonly used now. In this technology, a single cable is shared among the users between the Internet provider and user at cable end. They share the bandwidth so the internet speed is same for all users at most case. The main drawback is, internet speed may be slow when all users access the network at the same time.

Cable broadband is managed by cable modem. It is located at the edge of the user network and connects to the Cable Modem Termination System (CMTS). CMTS is used to connect multiple ISP core network.

Fiber Connections

Fiber network transmits data in form of light and transmission speed is high compared to other networks. It can travel up to several miles without degrading. Fiber uses Optical Network Terminator (ONT), which converts data from Fiber network can understand to data which copper wire or other traditional network can understand

Wireless Networking

It is a way of establishing a network without wires. The communication between wireless devices are given by the standards of 802.11. There are several types likes 802.11b, 802.11a, etc. all these follows the same except few minor changes.

802.11 has several fields like Frame control, Duration, Source address, Destination address, Receiver address, transmission address, Sequence control and checksum.

Wireless Network Configurations

Ad-hoc network – In this network, every node directly communicates with each other. These are commonly used in IOT devices

Wireless LAN – These are most common in the business industry. Every Local network, that is connected to gateway router through wires are further connected to the Wireless Access Points (WAP). The WPA acts as a interface between the wired and the wireless network. When mobile needs to communicate with the node in LAN, it sends to the WAP and WAP will forward traffic to the respective node.

Mesh network – It is the combination of the above networks.

Wireless Channels

A WiFi channel is the medium through which our wireless networks can send and receive data. For routers made in the U.S., the 2.4 GHz band has 11 channels and the 5 GHz band has 45 channels.

Wireless Security

In wireless network, data is transferred through channels and anyone can read your data. There are several methods to provide network security

WEP (Wired Equivalent Privacy) – This was the first security method that encrypts data with 40 bits. In the modern networking, 40 bits encrypted data can be easily decrypted and so this method is not used now.

WPA (WiFi Protected Access) – The standard WPA encrypts data with 128 bits and it makes harder to decrypt message. Then WPA2 was came into existence and it encrypts data with 256 bits which makes further harder to decrypt it.

MAC filtering – This will allow only the specific MAC address to access the network which are specified by the client.

Cellular Network

Cell phones establishes network with a network tower, that are local to a specific area called Cells. The cell phone transmits data through the radio signals to the base station and if further forwards it to the intended client.

Bits and Bytes of Computer Networking – Week 4

DNS (Domain Name System)

DNS is used for the name resolution. In modern networking, we cannot remember IP address of every website access it and also IP address is dynamic as it may change time to time. To overcome this, DNS comes into role where it assigns a name to a IP so we can use it access instead of IP address. There are 5 name servers which is used to connect domain named with IP.

  • Caching/Recursive name server
  • Root name server
  • TLD name server
  • Authoritative name server

Caching name server is also a Recursive name server but it looks for the previous records rather than performing the entire process. Root name server receives the request in a zone and forward TLD(Top level domain) to the TLD name server. There are 13 main Root name server are present at the time. TLD name server maintains the domain names for the common domain extension such as .com or .in. The Authoritative name server will respond to Recursive name server with the information that is given by the organization like IP. Thus by following this process, a Fully Qualified Domain Name (FQDN) will be formed.

DNS at most time uses UPD. This is because, TCP uses SYN and ACK which may take more time and less efficient.

Resource Records

There are many resource records in which we discuss very few important one’s.

A record – It is used to point the IP address for the given domain. For example, 134.233.10.3 will be stored in A record for http://www.google.com

AAAA record – It is similar to type A record, but type A is assigned to IPv4 address where AAAA record is assigned to IPv6 address

CNAME (Canonical name) – For example, sometimes user may search for google.com instead of http://www.google.com . In such cases, CNAME is used. CNAME is used to map the domain into another domain.

DHCP

DHCP is mostly used for assigning IP addresses for the nodes in a network. There are few types of allocation in which DHCP use to allocate IP address.

  • Dynamic Allocation – In this method, a set of IP addresses is kept aside and when a client request for a IP, the DHCP server will allocated for it.
  • Automatic Allocation – This method is similar to dynamic allocation except it will keep a track of IP address which is assigned to client. So next time, the DHCP server will mostly try to allocate the same IP for the client.
  • Fixed Allocation – The client request IP to DHCP server with a specific MAC address. If not found, then it perform dynamic or automatic allocation.
DHCP Discovery Process

Initially, a client may not connected to the internet. DHCP server will helps assign a IP to client. There are four main processes in assigning a IP.

DHCPDISCOVER – The client will send a broadcast message to all the nodes with a destination port 67 and a source port 68. The DHCP server will receive message which present in the local server.

DHCPOFFER – The DHCP server will send a offer message message with a IP to the client at 0.0.0.0:68

DHCPREQUEST – The client will accept the request and send the IP request message to the DHCP server.

DHCPACK – Finally, the DHCP server will assign a IP to the client.

NAT (Network Address Translation)

NAT is used for hiding the IP address of the client and the server. Thus when a client send a packet to server, the packet is sent to NAT and the NAT changes the IP address of the client to its IP address and then it forwards it to the server. From server to client, the process again takes place. This process is also called IP masquerading.

Port Preservation – In this method, the port number chosen by the client is same as the router.

Port Forwarding – Lets take a web server that has IP with 10.1.1.0 with port 300. When client want to access it, he/she need not to know the IP address of the server rather they have to know about the external IP of the router. So when a client sends traffic to the IP of router with the port 300, the router will automatically direct traffic to the web server with the same port.

VPN and Proxies

VPN (Virtual Private Network)

VPN are used to provide access to the network, in which the user may not in the particular network. Lets take an employee of the company who is on vacation, but he needs to access the company network. The VPN acts like a tunnel and the employee can access all the private network from his location without actually present.

Proxy

Proxies act as a intermediate between client and server. They are similar to firewall and is used to filter the users based on location.

Reverse Proxy

A organization may contain many server but in outside, it looks like they are a single server. Reverse proxies are used to direct traffic to different servers.

Bits and Bytes of Computer Networking – Week 3

Transport Layer

Transport layer is used to transfer data between the end to end user, ensuring a reliable communication. It has two main protocols, TCP and UDP.

TCP is connection oriented protocol, in which each computer sends acknowledge to every data it received. It is used in messaging app which ensure that the sent message has been received by the other user.

UDP is connection-less protocol, in which the computer does not wait for the acknowledge from the other computer. Example, streaming a video on youtube.

Port

Port is a 16 bit number that is used to direct traffic to the specific services that is running on a computer network. For example, the port 80 denotes the web service (http). 1-1023 ports are called as the system ports. 1024-49151 ports are called as the registered ports. These ports are used by the users for their own server applications. Remaining all are Dynamic ports.

Firewall

Firewall is used to block traffic, that doesn’t met the certain criteria. For example, the server opens the port 80 for listening http request and denied access to other request like FTP(21). So, when a user request for the port 21, the firewall will automatically deny the access at the entry level

Application Layer.

In OSI model, the application layer is further divided into 3 Session, Presentation and Application. Session layer is used for opening, closing, establishing and terminating session between the end to end application. Presentation layer is used for formatting and converting data and ensuring whether the data is presentable for one application which is sent through network in other application. Application layer provides interfaces and protocols that are needed for the users. HTTP, SMTP, FTP, etc. are some example of application layer.

Working of all layers together

Let us consider computer A wants to open a connection with computer B. The computer A will create a TCP with a specific source port(4000) and destination port(5000). The computer B will open make the port 5000 to listen for incoming connections. This process will take place in transport layer.

In Network layer, IP datagram will be created with specific source and the destination IP address with checksum. This will encapsulate the TCP with IP datagram.

In Datalink layer, ethernet frame will be created with the respective source and destination MAC address with checksum. This will encapsulate IP datagram with the Ethernet frame. If the MAC address of the Computer B is unknown, it will check in ARP table for MAC address for the respective IP. Even though if not found, then the computer A will send a broadcast to all computer in local network. By this method, the local MAC address of the node or router will be found.

The computer A will send the frame to router. The router will perform checksum operations in Ethernet frame to check the data loss or inconsistency of data and then it splits ethernet frame and remove it. Following this, it will check the IP datagram for any loss. If no loss exists then it splits IP datagram from it. Now the new IP datagram and Ethernet frame will be created with new source and destination along with the checksum. If a frame travels from one router to another, TTL (Time to Live) field will be reduced by one. The most common TTL field is 64.

After all, the frame will be sent to the respective IP network and then it further sends it to the computer B. This is the single synchronize request from computer A to B. Following this, the Computer B will send Syn and Ack to computer A following all the steps. Then the computer A will send Ack to computer B. This process is called Three – way handshaking.

Bits and Bytes of Computer Networking – Week 2

Network Layer

Network layer is responsible for sending and receiving information through network. It uses IP to send and receive data. Like ethernet frame in Data-link layer, Network layer uses IP datagram to send and receive data. It has several fields like Header, flag, Identification, source and destination address and such fields. If a client has to send a data which is larger then the size of the IP datagram. then the data is fragmented and sent to other user. To identify the order of the data, Identification field is used. Flag indicates whether the data has been fragmented or not.

These fragmented IP datagrams are received on the other used side and encapsulated to represent the original data.

IP Address

IP address is used to specify a network. IP address is automatically assigned by protocol named DHCP (Dynamic Host Configuration Protocol). IP address has two types Static IP and Dynamic IP. Static IP is used by the network organizations while the Dynamic IP is used all users which is assigned by the DHCP.

IP address is a 32 bit number which is separated by a decimal value at each octet. It has two parts Network Id and a Host Id.

IP Address Class

If first octet is used as network id and remaining as host, then its Class A. If first two octet is used as network id and remaining as host id, then its Class B. If first three octet is used as network id and remaining as host id, then its Class C.

ARP (Address Resolution Protocol)

ARP is used to identify the hardware address of a node with the help of IP address. ARP maintains a ARP table where it contains MAC address for the corresponding IP address. If Mac address not found, the ARP will send a broadcast message to every nodes. The node which is intended to receive the message will send a ARP response with a Mac address to the node with sent a broadcast.

Subnetting

Subnetting is process of splitting the network into smaller one. Subnet mask is helps to identify the network id and host id. Subnet mask is a 32 bit number, where the network bits are assigned to 1 and the host bits are assigned to 0. With AND or OR operation in IP and Subnet mast, the network id or host id can be easily extracted for the IP.

CIDR (Classless inter Domain Routing)

Each octet ranges between 0-255 (2^8). 0 cannot be used and 255 is reserved as for the broadcast. if a organization needs a IP with just more than 300, then they have to choose Class B instead of Class C. This will result is wastage of 60000+ space. To overcome this, CIDR was introduced where the is host id is assigned based on requirement. It is assigned as 9.100.100.100 / 23. The 23 denotes that the first 23 bits of 32 will be used as the network id and the other 9 bits will be used as the host id.

Router

Router is network device which is used to send and receive data packets through networks. It has four main steps 1) Receives the data packet. 2) Examines the IP datagram 3) Looks for the destination network. 4) Send packet to the destination network or to the router which is nearer to destination network.

Router maintains a routing table which has fields like next hop, total hop, destination network. Hop is a rough measure of distance between the two routers.

Routing Protocols

Routing protocols are divided into two Interior gateway protocols and Exterior gateway protocols.

Interior gateway protocol are used within a Autonomous System and are further divided into 2 Link State Routing Protocol and Distance Vector Protocol. In Distance vector protocol router will be connected to the nearest one and thus it takes some time when network changes. In Link State Protocol, every router will be connected to every other router so transmission will take soon.

Exterior gateway protocol are used to connect with the various Autonomous systems. Most commonly used exterior protocol is BGP (Border gateway protocol)

Non-Routable Address Space

In this method, the gateway protocol will not transfer the traffic to the Non-Routable Address but the nodes can communicate within the autonomous system.

Demarcation Point is a point where one network end and other network starts.

Bits and Bytes of Computer Networking – Week 1

I have taken a course in Coursera to learn the basics of computer networking. I have complete the week 1 assignment which gives a introduction to TCP/IP model and networking devices.

TCP/IP Model

It consists of 5 layers and are Physical layer, Data link layer, Network layer, Transport layer and Application layer. The physical layer deals with the physical device connected to the computer, normally a cable wire which is used to communicate with each other. The data link layer is used to send data between two nodes in a network.

Hubs and Switch

Hubs are used to establish a communication in a Local area network. They receive the data from one node and sends to all node in the LAN. All nodes will receive the data and only the node which is intended to receive the data will accept and other nodes will ignore it. This sometimes results in Collision Domain (When data is sent from multiple nodes, collision of data may occur).

To overcome this, Switch was used. Switch is intelligent device which is used to send the data only for the respective node. Switch uses MAC(Media Access Control) to identify the node which is globally unique address.

Hub is a physical layer device where Switch is a data link layer device.

Unicast, Multicast and Broadcast.

if the LSB(List Significant Bit) of first octet of the destination address is 0, then the ethernet act as Unicast. If the LSB of the first octet of the destination address is 1, then the ethernet act as Multicast. If all the bits are ff, that is ff:ff:ff:ff:ff:ff, the it is Broadcast.

Ethernet

Ethernet is a way of connecting computers in LAN. In order to avoid collision domain, ethernet uses CSMA/CD (Carrier Signal Multiple Access / Collision Detection). This ensure whether the channel is free to send or receive data. Ethernet uses BGP (Border Gateway Protocol) which is used to find the best path between the node. For example, Its likely to a GPS in our mobile which is used to find the best path between two places with respect traffic or other problems.

Ethernet Frame

Normally, all the data in network will be sent as a data packet. A single set of collection of bits is called data packed. In ethernet, it uses ethernet frame to send data. It has few blocks like Preamble, source address, destination address, payload, FCS(Frame Check Sum). FCS is to check whether the data is received without any loss with the help of Cyclic Redundancy .

Dynamic Memory Allocation

From today, I started to learn important concepts in computer languages. For today, I decided to learn dynamic memory allocation. It is used to allocate memory by the user itself based on the their requirement. It has four methods for allocating memory.

  • malloc – This will create the memory in the Heap space in ram. We should pass the size as the argument. The return type is void so we must explicitly type cast the of pointer. For example int pointer will be (int*)malloc( 4 * sizeof(int) )
  • calloc – Contiguous allocation, It is used to create 4 different space in memory. Example (int*)calloc(4, sizeof(int))
  • realloc – It is used re allocate the space of memory in which the pointer has already assigned
  • free – It is used to remove the memory allocated to the pointer. We should pass the allocated pointer as the argument.

Mock Placement

Even though its Sunday, I gone to college because of mock placements. I attended few companies and this made me to realize at which stage I’m in. Since it was the first interview, I felt nervous and then after attending few companies, it was really fun.

Web design Competition

I formed a team with my friends and participated in a web design Competition which was conducted in my college. The competition theme is to create a website to market a particular product. I chose to create a website which markets apple watch. We created and posted it in Git and we are waiting for the results.

A long break

It’s been a long time since I posted my last blog. Online classes, internal exams and semester exams made me to forgot my daily routine. In this interval I joined a python internship and my daily task it to complete a program which is give by them. We did a final project but the project manager didn’t accepted it. Then I found a internship through internsala and I’m currently working on it.