IPv6 - Neighbor Discovery Protocol - Neighbor Solicitation messages - networking

I'm studing on this topic, and I learned that, when a node joins a network, it creates a local unicast address based on his MAC, then send a Neighbor Solicitation message to the multicast neighbor-solicited group of that address for detecting any duplicate.
Then it sends a Router Solicitation message, it receives (hopefully) a Router Advertisement message containing the network prefix, and then it create his global unicast address based on this informations.
But, as you can see in this screenshot (look at the highlighted packets), my node joins the network and sends the first NS, as described above, and then a second NS with targed address his global unicast address already built, without first sending RS and getting RA with network prefix.
Can someone explain how it gets the network prefix? Maybe it collects the RAs that the router was sending before it sends his NS? I hope that someone help my understanding this. Thanks

Related

Can a pure peer-to-peer network reassemble itself after all the nodes have been rebooted?

The setup is this:
We have a group of computers that have public ip addresses assigned to them so that they can access the internet. these computers are connected together forming a pure (trackerless) peer-to-peer network.
My understanding of the public ip address system is that those addresses are not unique to each router meaning that a router can have an ip address today and have a totally different one tomorrow or in the next hour or maybe a week from now.
The problem is what happens if nodes in the network have had their public ip address changed to a new one while they were not connected to the network. how are these nodes supposed to rejoin the network?? should each node maintain a list of all the public ip addresses of the all the nodes in the network and try to open a connection to each one of theme?? if yes what if the network has a million nodes, what about timeouts if the ip address is still the same but the connection failed for some reason??
Another problem arises when all the nodes have had their ip addresses changed simultaneously. how are they supposed to reassemble the network without any working ip addresses??
it would be appreciated if you could recommend books, articles or videos that explain how peer-to-peer apps like trackerless file sharing apps function on a more technical level (Nat traversal, and initial bootstrapping to the distributed hash table).
The fix is either to have a registrar at a well known address (i.e. not a peer) or seed each node with address of a number of peers (say, 10 or 100). I seem to recall a paper on this and it's was a relatively small number to find a live node in practice. When a peer boots up try to each peer till you find the network. Once you find one, you can get a current seed list and figure out which peers you want to connect to.
The other question that also comes up (along with NAT) is how do you connect to node behind a firewall. The term you want to look up is Hole punching.
If your nodes are on a lan you have broadcast options. This is how DHCP works for instance. You might want to check out Zero-configuration networking. Multicast might be an option on wan.

Why only MAC address is used to transfer the packet to a device?

I am sorry if its basics, but I did not find the appealing answer for it over the Internet.
Why only MAC is used to transfer the packet to a device ? MAC address is only obtained by ARP for a specific IP address. So, why not just let the routers maintain IP addresses of the neighbouring routers and route packets using IP addresses of routers instead of MAC addresses ?
Why not redesign the architecture, to only use IP address for routing as well as moving the packet in the data link layer too ?
Why do we need MAC addresses?" Why can't network devices such as the routers just send the packet to the next router using the router's IP address?
Note : I know that MAC address is used to identify the system in a network. But you see the source never knew the MAC address of receiver. All it knew was its IP address and MAC address of next hop.
I'm reading Data Comm and Networking by Forouzan ( Ed 5) and it says that even routers have an IP address. So why use the mac address at all. The router can store the IP address of the source and route it to the next router .
EDIT : The question that I was getting as suggestion to this one does not answer my query. There are multiple counter points and proof that I have presented here which could have been done which is not answered by the one which is suggested. So please read my question before making any assumptions.
What do you think makes more sense: Having one protocol like Ethernet handle all the layer 2 details so that its layer 3 payload doesn't have to care, or force IP, ARP, WoL, IPX, MPLS, SLPP, and dozens more implement it on their own? The whole purpose of OSI layers is that upper layers need not know all the lower layer's details and lower layers need need not support the upper layer's features.
MAC addresses are used for the layer 2 protocol which encapsulates a layer 3 protocol. If all the necessary features were embedded into IP, then you'd be leaving other protocols to re-implement layer 2 routing on their own. This would be wildly inefficient.

Source MAC address on Ethernet layer 2

My question is pretty basic and my apologized for that. In TCP/IP network, if you take a look on layer 2 (Ethernet), we have some fields like Source and Destination MAC address. If you think in your browser, it is totally understandable that you can type a IP, and then the layer 3 (IP) will know the destination IP, then the frame is sent to layer 2.. However, how the layer two know the destination MAC address ? The source MAC address is stored in the network card and it is understandable but on what part of communication the destination MAC address will be known ?
I will give you the basic of how the routing works. This will clarify your doubts:
1) Assuming that we have a layer 3 IP packet which we want to send to some destination which have a DIP = y.
2) The route lookup in the routing table would give you the next hop and the outgoing interface through which the packet needs to go out.
3) Now we have the next hop. Still we dont have the layer 2 encap information which is the DMAC. Assuming this is the first packet we are sending and we dont have the DMAC vs next hop IP mapping yet.
4) The system will generate a ARP Query which will be broadcasted with a DMAC FF:FF:FF:FF:FF:FF within the subnet. This query asks who has the the next hop IP. (Remember we got this from the route lookup).
5) The router having the next hop IP would respond back to the src router (Unicast reply), thus we would know what is the DMAC that needs to be put on layer 2 header.
6) The L3 packet will now be encapsulated in layer 2 header with the dmac as already known now.
7) Remeber the dip won't change in the layer 3 header. This way the packet would traverse hop by hop. At each hop the layer 2 DMAC would change and not the DIP.
Remember that the MAC address identifies each router uniquely on a hop by hop basis.
Hope that clarifies your doubt.
Your computer determines the destination MAC address of the next hop is typically determined on an Ethernet network by using ARP, an Ethernet broadcast protocol that allows you to ask which device is assigned a particular IP address.
MAC address is resolved using layer-2 devices such as network switches. ARP tables is the tool to resolve IP to MAC.
# arp -an

Data link layer + Network layer connections

I'm reading up on networking and there is something about the layer 2+3 OSI model interaction i don't get. I want first to understand the basics so feel free to keep it simple.
Lets say we have a LAN - 5 computers all connected to a router which is connected to an ISP router.
1.
one of the PC on the LAN wishes to send a message to another PC on the same LAN(they are both connected to the local router but not to each other directly) -
is there layer 3 encapsulation in use here?
if not - and we only use the layer 2 information, what is the path the message will go through? is it PC1->PC2 , or PC1->Router->PC2.
if it is going through the router - what information is added in each message transaction?
and if not - do PC's on the same LAN (connected to the same router in some layer 2 protocol) aware of each other? can they message each other although they are not connected directly
2.
one of the PC on the LAN wishes to send a message to a PC outside the LAN (way way outside).
i understand it goes PC1->Router->ISP Router -> ......... -> recipient local router -> recipient
which entity adds the layer 3 data? is it the router? PC1? ISP router?
when will this information be needed? since all single transaction is connected by devices who can talk between them self's in layer 2 protocols? (PC1 talks to it's router in level 2 protocol, so does Router to ISP router... etc?)
any further information worth adding will be appreciated.
Thanks!
Is there layer 3 encapsulation in use here? Yes it is! The two computers are connected in a network created by your router, which is a Network Layer Device. When the sender sends a packet it doesn't know where is the receiver (in LAN or in Internet), so it prepares to send the packet as usually. Then the router checks his table and knows that the receiver is connected with it, but until this happened everything was going on normally. So, the thing you have to understand is this: while it is a communication between two machines, all the protocols of each layer must be accomplished. If the computers would be connected with a switch, a Data Link Layer device, the authentication would be made with their MAC addresses instead of their IPs, so there is not a Network Layer here(obviously no layer 3 encapsulation ) but this is not your case.
That's a long story to tell how the packets travel from sender to receiver. But in general, there are two important information that each packet should have: the address of the destination machine(Network Layer), and an identifier of the process that should receive the packet in the destination machine (Transport Layer). If it is the first time that the machines communicate with each other, the router connected with the sender broadcasts that packet in all its outbound lines, and so on with the routers which receive this packet, until the destination is reached. After the first packet has been sent the routers keep records on their tables how to locate each machine in the best way possible. This will make broadcast unnecessary next times. So, the packet reached the destination. The receiver probably has a lot of processes opened in that time (open your Task Manager -> Processes to see what I'm talking about). This is where T.L protocols appear. They use the identifier in the head of the packet to address the packet in the right process. And than the communications goes on with Application Layer Protocols.
I hope that this is a useful information for you. If you really want to study this things I would suggest you Computer Networks of Andrew Tanenbaum.
If I understand OSI right - it's just an abstraction. http://en.wikipedia.org/wiki/OSI_model#Description_of_OSI_layers Your messages send in packets which is Transport layer. Those messages are built by means of Network layer. If there wasn't this layer packages data(information you send) wouldn't know how to encapsulate into a package.
if it is going through the router - what information is added in each message transaction
Each package consist service fields http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure
Each time it passes throw a router, router adds information to a header (IP ...) to let the package receiver know where it came from ( it's network layer, because you don't add this information by yourself, it does network for you)

Same IP Address for two different nodes on same network

I'm wondering if two nodes on same network/sub-network can have same ip addresses?
Now i know that by definiton ip addresses are unique and that's how nodes are identified on network layer but i got this question in a quiz paper so is that possible anyhow?
For eg if i am on a private network and then if try to set same ip addresses for two different nodes it gives IP adress conflict but answer was YES in that quiz for this question.So if anybody can suggest any possible reason,it would be deeply appreciated.
Please let me know if it's not possible.
they can, but they must not.
If the client know or cache the mac address , it can comunicate with one node
but the next arp request can change the mac address and continue with the other.
It can send udp message to the wrong node , but broke tcp connections.

Resources