Solved

Computer / Network protocols used for two directly wired computers

Posted on 2015-01-17
27
103 Views
Last Modified: 2015-03-04
Hi,
I have a very basic question on Computer Communication / Networking.

1. If I have two brand new computers with the standard NICs installed. What protocols would be used if i connect them directly using a cross-over cable but without assigning any static/dynamic IP address. Will their be any connection between them without an IP address assignment?

2. What protocols would be used if I connect the two using a Hub or a switch but no IP addresses assigned?

3. If on a LAN hosting a DHCP server, what protocols would be triggered BEFORE acquiring a dynamic IP from the DHCP server? and what protocols after the DHCP server and at which OSI layer they work?

Thanks
0
Comment
Question by:zen shaw
  • 13
  • 8
  • 2
  • +2
27 Comments
 
LVL 50

Accepted Solution

by:
Don Johnston earned 500 total points
Comment Utility
1) It's been a LONG time since I tried anything like this.  But IIRC, I think NetBEUI operated at layer 2.   But that was long ago so it wouldn't surprise me if that functionality is no longer supported.

2). Same as #1.  Directly connected, hub, switch (layer 2), is all the same for the purposes of your question.

3)  Ethernet (layer 2) and IP (layer 3).
0
 
LVL 90

Expert Comment

by:John Hurst
Comment Utility
What you want won't likely work. Try a small switch. They are really inexpensive (probably less than a crossover cable).

The best solution is a router that provides DHCP and will make the job really simple. Even simple routers are inexpensive.
0
 
LVL 2

Expert Comment

by:phil435
Comment Utility
1. APIPA would be used which is 169.254.0.0/16. When you don't have static addresses or a DHCP server then you will use Automatic Private IP Addressing. The most common protocol between machines is TCP/IP and yes there will be a connection between them using APIPA as the address scheme.

2. Same as above since it's assumed you are not using static or have a DHCP server

3. DHCP is the protocol. To understand how it works read up on DORA. http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol

I'm a little confused on your question of what protocols are used before and after DHCP.
There can be many protocols running on a network and DHCP is just one of them.
0
 

Author Comment

by:zen shaw
Comment Utility
Hi,
Thank you all for your reply.

I am trying to understand the basics as I am frustrated with interviewers asking questions on network fundamentals which we would all forget.

Basically, what we are using is Ethernet networks which uses CSMA/CD for network communication (alternative Token Ring, Token Bus, FDDI etc). So without using TCP/IP can Ethernet on itself provide communication between two nodes?

APIPA is again using TCP/IP . Without TCP/IP how would machines communicate. When does TCP/IP come into picture and what hardware/software within my computer implements TCP/IP protocol. (Ethernet/IP for industrial use is an alternative to TCP/IP) what other protocols are available.

What tools do I use to troubleshoot
a. Ethernet only connectivity
b. TCP/IP over Ethernet connectivity

I am just trying to understand the network fundamentals here.

Thanks
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Windows and Linux computers always, to my knowledge, include TCP/IP in the original installation.  I have not seen any other protocol installed without specifically adding a driver for it.  And I have never seen an Ethernet only installation.  But Ethernet does actually provide the point-to-point communcation using MAC addresses.  The Ethernet frames carry the TCP/IP packets.

This article http://en.wikipedia.org/wiki/Ethernet about Ethernet contains a lot of info... but most of the TCP/IP alternatives are not mentioned because they are rarely used anymore because they do not provide internet access.  At least not by themselves.
0
 
LVL 2

Expert Comment

by:phil435
Comment Utility
Ethernet is the layer 2 protocol and the most common in networks today. Sure two nodes can communicate directly over layer 2. Such protocols such as spanning tree in switches work in layer 2.

Your statement of ethernet/IP AND TCP/IP is not correct. TCP operates at layer 4, ip layer 3, and ethernet at layer 2. Each layer operates independent of one another. Each layer has a header and gets stripped off as it goes down the model. So when you get down to ethernet devices are talking to each other with a mac address. Cisco has many good books on understanding networks that you can check out.

Almost all networks today implement ip. As for examples let's use http. Http is one protocol used in browsers and knows nothing about TCP,ip, or ethernet. However your OS handles this by packaging http over TCP/IP. If your using switches or hubs then this will be at layer 2. Most devices today are switches so you don't need to worry about collisions, so when you mention csma/cd this is typically in a hub environment.

As far as troubleshooting software, I use wireshark. But before you did into this you need to get a good understanding of how networks operate. CCENT by Cisco is a good place to start. Even if your not looking for certification this is a good starting point for learning networks.
0
 

Author Comment

by:zen shaw
Comment Utility
My confusion is because of this statements

"Switches work at Layer 2" or "If the communication is between two nodes in the same network either directly or via a switch, then they communicate at Layer 2"

If the above statements are true ... why do we need IP Addresses which are Layer 3 element.

Why can't two switches talk to each other using Layer 2 protocols only ... why is there a need for Layer 3 addressing? If we say that they depend on Layer 3 IP addressing then Layer 2 addressing (MAC) is not enough for devices to communicate.

Sorry for being dumb here ... :)
0
 
LVL 50

Expert Comment

by:Don Johnston
Comment Utility
No.  It's not a dumb question.  I get this exact same question in class all the time.

The answer is: They could communicate using Layer-2 protocols only.  In fact, in the past, that was quite common.

But it falls apart as the network gets larger.  Currently, for hosts, we use ethernet. The Layer-2 addressing in that environment is the MAC address. Each network interface card gets its MAC address assigned when it is built.  But the addresses are location insensitive. Which means that there's no way to determine WHERE a device is by it's MAC address.

So lets say you know what Google's MAC is. You send a message to that MAC number.  How does the networking device know where that MAC is located?  If we're talking switches, that means every switch has to have every MAC in the entire world.  Which could be around 3 trillion hosts.

So we use Layer-3.  Part of your IP address only identifies what network you're on.  The other part identifies who you are on that network.  This is like a phone number.  Part of your phone number just identifies what exchange you're on. The other part identifies you on that exchange.

In networking, routers only care about what network a packet is going to.  So it only needs to have a list of the networks.  For the full internet routing table, that's almost 500,000 networks.  Which is puny compared to how many hosts there are.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
I was under the impression that MAC addresses could only be used between computers on the same physical network segment where the MAC addresses are directly 'visible'.  I wonder about switches and/or hubs having MAC addresses too.  ??
0
 

Author Comment

by:zen shaw
Comment Utility
@Don: Yes I understand that Layer-3 addressing is required to locate where the node is over the internet. But within a LAN there is no need for Layer 3 addressing since each node will be connected to the switch port, and the switch will know who all are connected to the various other ports on it.

Says Node A with MAC XX:XX:XX:XX:XX:XX is sending a message to Node B with MAC YY:YY:YY:YY:YY:YY, then the switch (say 8 port Ethernet) will know that Node A is connected to Port 1 and Node B is connected to Port 4. While Node C with MAC ZZ:ZZ:ZZ:ZZ:ZZ:ZZ is connected to Port 8 ... the switch can easily send the traffic from Node A to Port 1 and the Port 4 to Node B .... without sending traffic to Port 8/Node C ...

If this is possible within a LAN and switches do use this ... what is the need of Layer 3 Addressing now? ... why do we have to give IP address to Node A and B even though they connected to the same switch?

@Dave: All devices on the network will have a MAC (globally unique) ... it can be changed / manipulated (MAC Spoofing) ... if you interested in advanced concepts.
0
 
LVL 50

Expert Comment

by:Don Johnston
Comment Utility
If this is possible within a LAN and switches do use this ... what is the need of Layer 3 Addressing now? ... why do we have to give IP address to Node A and B even though they connected to the same switch?
Because it is almost unheard of today to have devices that never communicate outside of their local broadcast domain.   And even if you do have that requirement, now you'll have some devices that communicate using one method and other devices using a different method. What would be the gain of that?
0
 
LVL 90

Expert Comment

by:John Hurst
Comment Utility
I have no idea what you will accomplish. As noted waaay back here, just use a small switch or router. All done and it works.
0
 

Author Comment

by:zen shaw
Comment Utility
So then it means ... the nodes have Layer 3 addressing only for inter-LAN communication. Within the LAN, the switch ignores the IP addressing and only uses Layer 2 addressing to establish communication between two nodes?

If the above is right, why do we have to give Layer 3 IP addressing to the two nodes within the same LAN (as they are ignored anyway)? we can not we establish communication between two nodes within same LAN without an IP assigned to each node.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:zen shaw
Comment Utility
@John: Thanks. I am just understanding the concept / theory behind.
0
 

Author Comment

by:zen shaw
Comment Utility
To complicate the matter more, if we try to understand how switches work ... they use both MAC and IP addresses in their ARP table ... so technically even the switch is using Layer 3 addressing. Am I wrong?
0
 
LVL 50

Expert Comment

by:Don Johnston
Comment Utility
So then it means ... the nodes have Layer 3 addressing only for inter-LAN communication. Within the LAN, the switch ignores the IP addressing and only uses Layer 2 addressing to establish communication between two nodes?
Yes.  

If the above is right, why do we have to give Layer 3 IP addressing to the two nodes within the same LAN (as they are ignored anyway)? we can not we establish communication between two nodes within same LAN without an IP assigned to each node.
Like I said before, it is very unusual to have a network where devices only communicate with other devices on the same network. Since we want to communicate with devices on other networks, we must use a layer 3 protocol.

To complicate the matter more, if we try to understand how switches work ... they use both MAC and IP addresses in their ARP table ... so technically even the switch is using Layer 3 addressing. Am I wrong?
Incorrect. Layer 2 switches only have IP addresses and an ARP cache to communicate for management purposes.  Not for forwarding.
0
 

Author Comment

by:zen shaw
Comment Utility
So on the same LAN, technically the Nodes do not require Layer 3 addressing but since in day to day life the nodes will also be used to communicate with nodes across LANs, Layer 3 addressing is used. So instead of having Layer 2 addressing of intra-Lan and Layer 3 addressing for inter-Lan communication, the nodes use encapsulation of both Layer 2 and Layer 3 addressing. It is then for the switch / router to decide what part of the header they want to use.
 
If the two nodes are on the same LAN, the Layer 3 addressing is ignored by the switch and the Layer 2 address are used for actual data forwarding, so its only the switch that is acting on Layer 2. So am I correct in saying that the end computer uses both Layer 2/Layer 3 addressing.

But is the switch really ignoring Layer 3 addressing completely, at least for management purposes it is using a ARP table with both MAC (Layer 2) and IP (Layer 3) ... when it receives a PDU, it is not just checking the MAC in the ARP  but also the Source and Destination IPs as well. The whole communication uses Source/Destination MAC in conjunction with Source/Destination IP. Its just that the switch does not have the capability to identify whether the IP is for this LAN or some other LAN and hence it can not route traffic inter-LAN. But it still uses Layer 3 IP Addressing to deliver the frames within the LAN.
0
 
LVL 50

Expert Comment

by:Don Johnston
Comment Utility
So instead of having Layer 2 addressing of intra-Lan and Layer 3 addressing for inter-Lan communication, the nodes use encapsulation of both Layer 2 and Layer 3 addressing. It is then for the switch / router to decide what part of the header they want to use.
Pretty much.  Except that Layer-2 switches don't decide.  They do not care about Layer-3 so it's never a consideration.

If the two nodes are on the same LAN, the Layer 3 addressing is ignored by the switch and the Layer 2 address are used for actual data forwarding, so its only the switch that is acting on Layer 2. So am I correct in saying that the end computer uses both Layer 2/Layer 3 addressing.
Yes.

But is the switch really ignoring Layer 3 addressing completely
For frames not addressed to the switch, yes.  Completely ignoring any header after the MAC addresses.
However, if the frame is sent to the MAC address of the switch, then the packet is handed off to the IP stack in the switch. Which processes the packet in just like your PC would.
0
 

Author Comment

by:zen shaw
Comment Utility
@Don:
"Layer 2 switches only have IP addresses and an ARP cache to communicate for management purposes.  Not for forwarding."

I guess I am confused and confused you too ... Layer 2 switches DO NOT have any IP Addresses ... the Layer 2 switches only have MAC table  which is the mapping between MAC and Port and NOT ARP table which is a mapping between MAC and IP Addresses. Hence, a switch is not able to understand IP Layer 3 addressing.

If a frame arrives with the destination MAC and it is available in the MAC Table of the switch, then the switch sends the frame to destination node via the associated switch. If it is not available, it just broadcasts to every port / node.

Since the node has ARP table (Layer 3), it detects are responds to the broadcast, when its reply reaches the Switch, it updates its MAC table with the destination nodes's MAC and the port it is physically connected. Thus communication is established.

Therefore,
a) The switch works at Layer 2 only (uses MAC Table - MAC to Port mapping)
b) The nodes work at Layer 2 (MAC) and Layer 3 (IP) using ARP table - Mapping between MAC and IP
c) Technically within the same LAN, nodes can communicate to each other  via the switch using Layer 2 addressing only and two nodes can communicate using Layer 2 addressing alone.

Eg: Node A with MAC xx:xx:xx:xx:xx:xx and Node B with MAC yy:yy:yy:yy:yy:yy can talk to each other via a Switch and there is no need of IP addressing at all.

d) But since the same node will also be used for inter-LAN communication, it used both Layer 2 & Layer 3 addressing. But within the LAN, the Layer 3 address is ignored by the switch. Thus the node will work at both Layer 2 and Layer 3.

"For frames not addressed to the switch, yes.  Completely ignoring any header after the MAC addresses.
However, if the frame is sent to the MAC address of the switch, then the packet is handed off to the IP stack in the switch. Which processes the packet in just like your PC would."

This is for the management of the switch and to configure it (Managed Switch). Does it do the same for Un-managed switch where there is no configuration?

or

You saying the above happens if the actual destination of the frame is the switch itself, if yes, why does it need an IP stack as it already knows its own MAC?
0
 
LVL 50

Expert Comment

by:Don Johnston
Comment Utility
This is for the management of the switch and to configure it (Managed Switch).
Yes
Does it do the same for Un-managed switch where there is no configuration?
No.  Unmanaged switches do not have an IP address. So the switch has absolutely no understanding of IP (or any Layer-3 protocol).

You saying the above happens if the actual destination of the frame is the switch itself, if yes, why does it need an IP stack as it already knows its own MAC?

Because you may want to communicate with the switch from a different network.
0
 

Author Comment

by:zen shaw
Comment Utility
Does the Node A send a control PDU / Frame to establish the actual communication? or it just sends the PDU/Frames and it is the duty of the switch to sort out the connection so that the actual data transfer takes place?

When a PDU is destined for Node X  on a different LAN, the Switch would check its MAC table and it will not be available and hence it would Broadcast that PDU to all the ports/Nodes. Since neither the MAC nor the IP is matched, none of the local Nodes would reply. So does it mean that all frames destined for foreign nodes, are broad casted to all the ports?
0
 

Author Comment

by:zen shaw
Comment Utility
Also, why not use Layer 3 addressing alone for inter-LAN communication as it can be used for both inter and intra LANs? why use Layer 2 addressing at all?
0
 

Author Comment

by:zen shaw
Comment Utility
@Don: You saying the above happens if the actual destination of the frame is the switch itself, if yes, why does it need an IP stack as it already knows its own MAC?

Because you may want to communicate with the switch from a different network.

How could that be possible for a Layer 2 switch to communicate on two different networks?
0
 
LVL 50

Expert Comment

by:Don Johnston
Comment Utility
Does the Node A send a control PDU / Frame to establish the actual communication? or it just sends the PDU/Frames and it is the duty of the switch to sort out the connection so that the actual data transfer takes place?
That would depend on what upper layer protocol is in use. For TCP, a segment is sent to create the connection with the destination device. But that's at Layer-4 and has nothing to do with Layer-2 switching.
When a PDU is destined for Node X  on a different LAN, the Switch would check its MAC table and it will not be available and hence it would Broadcast that PDU to all the ports/Nodes.
No. If the destination is on a different network, the frame is sent to the default-gateway. Which is always on the same network as the source host.
Also, why not use Layer 3 addressing alone for inter-LAN communication as it can be used for both inter and intra LANs? why use Layer 2 addressing at all?
That's just the way the system evolved.  Is it possible to completely eliminate ethernet? Sure. But everyone would have to replace all their existing hardware.  And what would be gained by doing that?  Certainly nothing that would justify the enormous cost.
@Don: You saying the above happens if the actual destination of the frame is the switch itself, if yes, why does it need an IP stack as it already knows its own MAC?

   "Because you may want to communicate with the switch from a different network."

How could that be possible for a Layer 2 switch to communicate on two different networks?
Because a managed Layer-2 switch has an IP stack. Which allows it to communicate using the IP protocol.  Please note that there is a difference between communicate and forward.
0
 

Author Comment

by:zen shaw
Comment Utility
Thanks Don for your explanation.

My next question would be "Communication between Node(Computer) and Router (Layer 3) via the Switch (Layer 2) ... How does the switch recognize if it is local or internet traffic", Anything that is not local, does it broad cast to everyone on the LAN or it remembers the Gateway and on which port it is connected?

If you want I'll start this as a new question or we may continue here.

Thanks
0
 
LVL 50

Expert Comment

by:Don Johnston
Comment Utility
When a host wants to communicate with any device, it first determines if that device is local.  It does this by comparing its own IP network with the destination host's network. If the two are the same, it's local. And the source host ARPs (if necessary) the destination host, learns the MAC address and sends the packet/frame to the destination host.

If it's not local, the packet (to the destination host) is placed in a frame with the default gateways MAC address as the destination address.

The switch doesn't know or care where the packet is going.  It is only concerned with the MAC addresses.  And in this case the MAC address happens to be a router which the it's knows about (because it's seen traffic from that MAC address before).
0
 

Author Comment

by:zen shaw
Comment Utility
What if the default Gateway is not defined?

a) Not defined on the Host as well as the DHCP server?

b) Not defined on the host but defined on the DHCP server?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Article by: rfc1180
The Maximum Segment size (MSS) is an important consideration when troubleshooting connectivity via the Internet/Intranet. As the packets are routed via the Internet/Intranet, the packets must traverse through multiple routers in the path between two…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now