Difference between Router,Hub,Gateway,Subnet,AP

Can anyone tell me the difference between the following and what it does and in which situation it is useful in brief.


please tell me in a network we will use all of these.

please make me clear about these topics.

thanks in advance.
Who is Participating?
Hi dinesh,

I will try and answer this in a way that helped me make my concepts clearer. Also I will reorder the way in which i answer the points coz a understanding of subnet will definitely help clear up what a hub/switch/repeater does.


Basically when IP addressing was created (back in the days of ARPANET), the inventors quickly found out that centrally controlling the division of IP addresses would make the situation very unmaintanable. So they decided to given the different organizations (govt, private, mil, or whatever) the ability to lay out their network the way they wanted.

So basically they allocated a Class B or Class A or Class C IP netblock to a organization and what the org does with the allocated IP addresses is their concern. So a company like AOL would be allocated a IP block like (class B) and then AOL would be able to deciede how to further subdivide the block.

So a SUBNET would be just one network block of IP addresses who share a common "NETWORK ID"

For example, for a class B address of, the network ID is and thus would identify the subnet.

Also it is a common feature of subnet that all the IP addresses (remember differing Host ID but same Network ID) would be able to reach any other node in the same "subnet" simply by using a procedure called ARP (Address Resolution Protocol.) For a detailed discussion see this: http://www.experts-exchange.com/Networking/Q_21182517.html

What ARP basically does is map IP addresses to MAC (Hardware) addresses that NIC (LAN cards) understand and thus can be physically reached. Physically reached means that they are on the same physical network segment interconnected by:

- cross over cables,
- hubs
- switched
- repeaters
- FDDI ring,
- frame relay, etc.

So if a computer on a subnet wanted to reach another computer on the same "subnet", it would invoke ARP to map the destination IP address to the actual MAC address and the ask its NIC to send the frame to the NIC with the specified MAC address (the NIC acts like a mail man, the dest MAC address like the apartment number and the frame as the 'snail mail') The salient point is that for ARP to work the dest IP address must be in the same subnet otherwise it would not get the request for the MAC address.

So if communication across subnets is required, then we use a --->

ROUTER (or interchangibily used GATEWAY)

A router has the ability to route packets across different subnets. For example lets connect two "made-up" subnets to our router (R):

N1: (/16 speifies that the network mask is which andded with the IP address gives the net id)

So intra-subnet communication takes place using ARP and the router is not involved in any way. However for inter-subnet communication we need that all the nodes in the src subnet use the router as there default gateway. So if they see that they have to send a packet to another subnet, they will instead direct the packet to the router (gateway.)

A very subtle point is that the router (gateway) must be present in the same subnet as the src subnet because otherwise the src node would not be able to send the packet to the router.

Ex: Let the router R have IP address for network N1. A host H1 ( wanting to send data to H2 ( would need to go via a router (R) and thus would need to have direct access (i.e. using ARP) to the R in the first place.

Usually the router is placed in the multi-homed configuration. That means the router has a IP address in more than one subnet. THis is the general scenrio. Obviously exotic situation are possible. Therefore in our example above, the router R would have two ip addresses in the two subnets (N1 and N2) it connects like so: for N1 and for N2. The nodes in N1 and N2 would specify the appropiate address as the default gateway to able to communicate across subnets.

Also there is nothing preventing routers from doing packet filtering. Infact, this is almost a essential feature of even the lowest end routers. Usually the routers performs NAT, FIREWALLING (i.e. packet filtering.) and loads of other features.

Hope this clears up the router part. But the router only help in inter-subnet communication, but how to achieve proper intra-subnet networking. For that we use:


Basically the HUB and SWITCH perform the same operation. But i will beg to disagree with the posts above mine as they give a wrong idea of what they do.

Basically the HUB has many ports and the only job it performs is that it replicated what it gets on one port on all other ports. So the collision domain is "single" meaning that if H1 wanted to communicate to H2 and H3 ---> H4 and all four were connected to the same hub a collision would occur. So basically we are sharing the bandwidht (10 Mbps or 100 Mbps) with all the connected nodes as simultaneous transmission via 2 streams is made impossible.

Smart engineers decieded to allevate the problem and made the hub smarter and introduced the concept of multiple-collision domains. Basically what it means is that the above scenario H1 --- > H2 and H3 ----> H4 is made possible as the data H1 sends to H2 will only appear at the port H2 is connected to and same for H4. Thus full utilization of the bandwidth can be made. Typical highend switched are complete systems in themshelves utilizing Microprocessors and Operating Systems (like Cisco Catalyst or IOS.)

So although they perform the same function, SWITCH does a much better job at it. Also, they didnt stop at that. They made the switches capable of much more and introduced features like VLANs (ability to host multiple separate subnets in the same switch.)

BUT BUT BUT, if we wanted to increase the geographical area covered by LAN then we would use a:


Basically the repeator is like a HUB but it is used to signal recreation. It is a active HUB. It collects all the bits together and then regenerates them before transmitting so signal quality is not lost. A typical CAT 5 cable has the physical limitation of being able to maximum go to 100 m length. This is because as the length decreases signal is lost due to resistance. So by introducing a repeater we would be able to extend the LAN segment ever further. Remember that REPEATORS connect the same SUBNET together, where as ROUTERs connect different subnets.

Salient point: We can use a maximum of 4 repeators in a particular LAN sengent. After all this is called a Local AN. If you want to go beyond that then use MAN or the Internet (a WAN.)


THis word has multiple meanings in multiple contexts. THe most basic meaning would be a physical connected (MIC) which allows you to tap into the network segment. Also Access Points are referred in relation to Wireless LANS where access points refer to the hubs which are radio capable.

A quick search of google will reveal many answers.

Hope this helps.

Do post back for any clarifications.


Hi dineshb_2001,
1) A router connects 2 or more different networks, or subnets

2) A hub is a glorified repeater.  The purpose of a hub is simply to centralizing cabling and provides a single collission domain. In a hub all the bandwidth is shared. This is opposed to a Switch which does a  similar sort of thing but provides multiple collission domains and works on the "data link layer."

3)Gateway, essentially a term for a router. A computer has a "default gateway" which is its path to get outside its own network/subnet

4) A subnet is the real "network" of a network. We tend to think of networks as very large things but ultimately each computer or node is on a particular subnet. Suppose you have the IP Address and a subnet mask of This means you are on the subnet This is opposed to a network which you are connected to via your default gateway with a subnet mask of Basically you split up a network into manageable parts using subnets. This is a very general definition.

5) An AP is an Access Point. We use this term in wireless communications. The AP is really a transceiver station which is something of a "Hub" for wireless devices to use. All wireless devices, unless they are in what is called "ad hoc" mode, will connect to each other using a particular access point.

Well, I hope this answers your question.

Hi dineshb


 A device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISP’s network. Routers are located at gateways, the places where two or more networks connect.
Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.
Very little filtering of data is done through routers.

 (2  )HUB

A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.
A passive hub serves simply as a conduit for the data, enabling it to go from one device (or segment) to another. So-called intelligent hubs include additional features that enables an administrator to monitor the traffic passing through the hub and to configure each port in the hub. Intelligent hubs are also called manageable hubs.
A third type of hub, called a switching hub, actually reads the destination address of each packet and then forwards the packet to the correct port.

(3) Gateway

 A node on a network that serves as an entrance to another network. In enterprises, the gateway is the computer that routes the traffic from a workstation to the outside network that is serving the Web pages. In homes, the gateway is the ISP that connects the user to the internet.
In enterprises, the gateway node often acts as a proxy server and a firewall. The gateway is also associated with both a router, which use headers and forwarding tables to determine where packets are sent, and a switch, which provides the actual path for the packet in and out of the gateway.
A computer system located on earth that switches data signals and voice signals between satellites and terrestrial networks.
 An earlier term for router, though now obsolete in this sense as router is commonly used.

 (4)  SUBNET

A portion of a network that shares a common address component. On TCP/IP networks, subnets are defined as all devices whose IP addresses have the same prefix. For example, all devices with IP addresses that start with 100.100.100. would be part of the same subnet. Dividing a network into subnets is useful for both security and performance reasons. IP networks are divided using a subnet mask.

   (5) Access Point
Short for Access Point, a hardware device or a computer's software that acts as a communication hub for users of a wireless device to connect to a wired LAN. APs are important for providing heightened wireless security and for extending the physical range of service a wireless user has access to.
Also see infrastructure mode and ad-hoc mode.
Also see the Wireless LAN Standards chart in the Quick Reference section of Webopedia.

Hope this helps

Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

dineshb_2001Author Commented:
Hi kidoman,

  your answer seems to solve my understanding of the basics. But at one point I got stuck.

As you said,

  ""Therefore in our example above, the router R would have two ip addresses in the two subnets (N1 and N2) it connects like so: for N1 and for N2. The nodes in N1 and N2 would specify the appropiate address as the default gateway to able to communicate across subnets.""

It means the two subnets has a same router with different ip address for each subnet (or) each subnet has their own router with ip address.

please calrify this.
dineshb_2001Author Commented:
and one more thing,

What I understood from ur description is , " router, hub , switch has an specific ip address just like a host has an ip address"  is this right.

I have a feeling of elation telling you this coz when I was having confusions in this area i didnt have anyone (or many EE points to spare) to get answers.

The two subnets N1 and N2 need a common router (or a path between them which is composed of 1 or more routers, like in the Internet.) So what happens is that a router R will have one IP address in the N1 subnet and one IP address in the N2 subnet. The diagram will clear up things a bit:

             ^--^-^-^-^-     ------|    /-+-+-+-+-+-\    |------        --------------
           /                    \                                   \|/  |                  |  \|/                             /                  \
          (    Subnet N1   ) |||||||||||||||||||||||||||   ROUTER   ||||||||||||||||||||||||(   Subnet N2  )
           \                    /                                         |                  |                                   \                  /
             ---------------                                            \-+-+-+-+-+/                                      --------------

Ofcourse there is nothing preventing a router from routing between 10 different subnet. Ofcourse the number of interfaces required increases.



Router has to have a IP address because "generally" it is used as a gateway for the subnet.

A hub and a switch "can" be assigned a IP address but that IP address is generally for SNMP (Simple Network Management Protocol) interfacing. Meaning, that IP address is assigned so that we can telnet into it ans stuff and do configuration like creation of VLANs, managing traffic, assigned which MAC addresses is associated with which port, etc.

Also some highend switches (like Avaya kind) can also act as a gateway. But basically it is a marketting gimick to call them a switch because Router activities are embedded within them.

Hope this helps,



Just one more point.....

the '|||||||||||||||||||||' connecting the subnet to the router is the following arrangement:

the router is plugged into a swich and also the rest of the subnet is plugged into that switch or a derived switch (a secondart switch connected to the main primary switch). Therefore, by doing this we put the router as well as the whole subnet within physical reach (via ARP) of each other.


dineshb_2001Author Commented:
Hi Karan,

  I respect ur feelings of being elated so I want to increase the points values even to 500. I understood the basics now. Hope in case If I have any doubts in networking may be u can help me.

And one morething do u have any knowledge on Mobile IP as I am doing my thesis on this area and now I have a big problem to know what is the method to find the HomeAgent in the internet. you can see my postings on these and anwers awaited for this.

with regards,
hi Dinesh,

Thanks man, really appreciate it.

I never had first hand experience with Mobile IP but I study in a environment where I get to experiment in a lot of things and we are implementing Wireless LANS in Adhoc networks.

Lets me see if I can be of any help.

BTW I am a UnderGraduage yet. Compuer Science.


dineshb_2001Author Commented:
Hi Karan,

 It`s good to know that you are an under graduate and had lot of knowledge in this field. Btw I am doing my masters in computational logic where I am doing my thesis in this field as I am interested in this field. So, I am starting from the basics.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.