Showing posts with label class A. Show all posts
Showing posts with label class A. Show all posts

19 December 2016

IP Address and its Significance


Every time we talk about network connection, whether WiFi or Ethernet or Mobile Data, there is one thing we always encounter if any of the above is not working.  We end up calling customer care and they would ask this question - Does your device has a valid IP Address?

What do they mean by a valid IP Address or an IP Address?



IP address


An IP address is a unique logical identifier of every device connected to the internet. EVERY single device, whether it is your laptop, phone, watch, smart home device, Amazon echo, smart router and anything which is interconnected. Strange right, because if every device has a unique IP address, why are we not running out. Well, the answer to that is we are actually running out of IP Addresses. Another answer to that is people involved in the formation of TCP/IP networking protocols had foreseen this and they came up with a workaround for that (Private addresses). A third answer is IPv6 - a newer generation of IP protocol.

Lets talk about why and how our devices get these IP addresses?

When you boot up your device, it is not connected to any network until the Wifi, mobile data or Ethernet module kicks in. So basically you would have a default IP address which is 0.0.0.0 and all the network interfaces will be inactive. (except loopback and local). Checkout what my Mac says when I hit "ifconfig" command (after disabling all network connections) :
------------------------------------------------------------------------------------------------------------
en0: flags=8823<UP,BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
ether ac:bc:32:c1:71:79
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (<unknown type>)
status: inactive
------------------------------------------------------------------------------------------------------------

When one of your network interfaces - WiFi or RF modem or Ethernet connectivity module starts, it will perform DHCP (dynamic host control protocol) which sends a broadcast to an available router and thus acquire a valid IP address (through leases). Your newly acquired IP address will look like this:
------------------------------------------------------------------------------------------------------------
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ac:bc:32:c1:71:79 
inet6 fe80::18b7:29d9:8bce:ecdb%en0 prefixlen 64 secured scopeid 0x4 
inet 192.168.0.13 netmask 0xffffff00 broadcast 192.168.0.255
...
media: autoselect

status: active
------------------------------------------------------------------------------------------------------------
DHCP mechanism

DHCP mechanism


If you want to learn more about DHCP mechanism, please leave a comment.


Classification of IP address

An IPv4 address is made up of 32 bits or 4 bytes so only 2^32 unique IP addresses are possible. As I said earlier, this is a very hard limitation as the number of devices are growing substantially everyday. I will talk about the workaround for this later in this section.

The total range of IP addresses is from 0.0.0.0 to 255.255.255.255 where each individual number is of 8 bits (8*4 = 32 total) also known as the octet. Originally the IP addresses were divided into classes based on the number of Hosts each class can support.

IP Address Classes can be classified as class A, B, C, D and E where A can support most number of hosts and C can support the least. Class D addresses were reserved for multicast purposes and class E for experimental use. The position of network ID and host ID was fixed at 8,16 or 24 for class A, B and C respectively.
Classful IP addressing

Classful IP addressing



However, due to address space wastage in classful addressing scheme (as the unused addresses within a class can't be redistributed), most organizations turned to Classless Addressing.


Classless Inter-Domain Routing 

With the increased usage of Internet, organizations realized the limitations of IP classes and started to move towards classless addressing where the network ID and host ID bits can be flexible (anything from 1 to 31). An address is represented as a.b.c.d/xx where xx denotes the number of network address bits, so for an address 124.128.xx.xx/9, 9 bits are reserved for network address and the rest 23 bits are for host address. This allows us to assign smaller/dynamic address ranges and also supports redistribution of addresses to other domains, if necessary.  Again, if you have questions regarding how this mechanism achieves scalability, please leave a comment.


So, is it possible to connect to a network without IP address?

When I was studying about IP protocol, I always used to wonder that if the TCP/IP layers are logical, then we probably don't need them if we want to just connect to a network in a raw manner. For network connectivity and data transfer, all we need is a medium (WiFi, radio), a device driver and raw data. On further study, this thought became stronger and it was proved correct during one of my academic project where I created my own data and sent this raw data via a medium (LAN).

One important thing that you must take care is of MAC address. As we all know that MAC address is the actual physical address that is used to identify a physical network device, it is necessary if we want to route a packet to a specific destination. Please leave a comment if you would like to learn more about MAC address and Layer 2 headers.

Example of a MAC address:
01-23-45-67-89-ab

MAC address

MAC address


Why don't we just use MAC address?

One simple answer to this is that there are different types of Layer 2 protocols and not thus Ethernet or WiFi. Protocols like ATM don't have MAC addresses.
Another very intriguing answer is that IP addressing has hierarchy which allows for distribution to domains (networks and sub-networks) and it is closely associated to DNS system. One can argue that we could build a DNS system for MAC addresses but that will be painful as MAC addresses inside a network don't follow any hierarchy and it is impossible to build a DNS lookup table for individual MAC.
Remember, when I said that IP addresses are limited, one of the most critical solution for that was Private Addressing within an organization. This eliminates the need of allocating a unique global IP to each member of that organization. If you check your IP address in your HOME network, it is a private IP, which means that all your devices connected to your router have private IP and only one global IP is used to identify your network. This kind of distribution is only possible through IP addresses and it is not feasible with MAC addresses.

There are a lot of questions that came to my mind while studying networking protocols and the reasons why this exist. You can keep me posted if you have any interesting question,  I will be glad to answer.

Any MX-5 fans, enjoy this video on the cute looks of Miata.


07 February 2013

General Packet Radio Service (GPRS)


Introduction

GPRS, as it reads General Packet Radio Service, was initialized by ETSI/SMG in 1994, to provide end-to-end packet-switched services to mobile users. GPRS was important as a migration step toward third-generation (3G) networks and allows network operators to implement an IP-based core architecture for data applications, which will continue to be used and expanded for 3G services for integrated voice and data applications.

Many Problems Solved 

GPRS enabled a variety of new and unique services to the mobile wireless subscriber. These features include the following:

Mobility: The ability to maintain constant voice and data communications while on the move.

Immediacy: Allowed subscribers to obtain connectivity when needed, regardless of location and without a lengthy login session.

Localization: Allowed subscribers to obtain information relevant to their current location.



GPRS Architecture

GPRS is a data network that overlays a second-generation GSM network. This data overlay network provides packet data transport at rates from 9.6 to 171 kbps. Additionally, multiple users can share the same air-interface resources simultaneously.

Following is the GPRS Architecture diagram:

GPRS Architecture

GPRS Architecture




Following two new components, called GPRS support nodes (GSNs), are added into existing GSM architecture with a few modifications in BSS and BSC:

Gateway GPRS support node (GGSN):
The Gateway GPRS Support Node acts as an interface and a router to external networks. The GGSN contains routing information for GPRS mobiles, which is used to tunnel packets through the IP based internal backbone to the correct Serving GPRS Support Node. The GGSN also collects charging information connected to the use of the external data networks and can act as a packet filter for incoming traffic.

Serving GPRS support node (SGSN):
The Serving GPRS Support Node is responsible for authentication of GPRS mobiles, registration of mobiles in the network, mobility management, and collecting information for charging for the use of the air interface.


GPRS MS Classses

The handset is probably the most well-known piece of equipment, because this is the part we use to make phone calls and to access data services. When we talk about advanced services, the handset is commonly called an MS, which consists of terminal equipment (TE) and a mobile terminal (MT). TE is the device that hosts the applications and the user interaction, while the MT is the part that connects to the network.

In order to take advantage of the new GPRS services, we need new GPRS enabled handsets. There are three different classes of GPRS terminal equipments:

Class A:
Class A terminals can handle packet data and voice at the same time. In other words, we need two transceivers because the handset has to send and/or receive data and voice at the same time. This situation makes class A terminals significantly more expensive to manufacture than class B and C terminals.

Class B:
Class B terminals can handle both packet data and voice, but not at the same time. In other words, you can use the same transceiver for both, keeping the cost of the terminals down.

Class C:
Class C terminals can only handle either voice or data. Examples of class C terminals are GPRS PCM/CIA cards, embedded modules in vending machines, and so on.


Network Processes

This gives a brief description of the basic processes used in GPRS networks:
  • Attach process: Process by which the MS attaches (i.e, connects) to the SGSN in a GPRS network
  • Authentication process: Process by which the SGSN authenticates the mobile subscriber
  • PDP activation process: Process by which a user session is established between the MS and the destination network
  • Detach process: Process by which the MS detaches (i.e., disconnects) from the SGSN in the GPRS network
  • Network-initiated PDP request for static IP address: Process by which a call from the packet data network reaches the MS using a static IP address
  • Network-initiated PDP request for dynamic IP address: Process by which a call from the packet data network reaches the MS using a dynamic IP address 
All the latest GSM phones available in the market are enabled to use GPRS services. So if you are planning to buy a GPRS enabled mobile phone then most probably you have to choose one GSM Mobile Phone unless you are using CDMA technology.

GPRS is a crucial step in the mobile evolution, and it opens endless possibilities for application developers and users. In the next article I will talk about UMTS and other 3G technologies.


About Me

My photo
Passionate about technology and humans