I am learning about subnets and doing some quizzes. I don't understand one of the questions and it doesn't explain it either. Question screenshot with answer
Can someone explain why the answer is 6 and not 1? Because you have 254 usable IP addresses and they can all fit into 1 subnet, right?
The reason why the answer is 6 is written in the output provided. In order to route between different ip networks you need to cross "transit" links, which in basic IP networks must be also addressed. Your response was correct (4) for the amount of subnets needed for hosts hosted behind those routers, but then you have two "uplinks" between those 3 routers that you need to account subnets for.
It's a bit of a misleading question though, because those "uplinks" can also be unnumbered (not having p2p IP addresses). I would have also answered 4.
Related
Recently, I have been putting a plugin on my Wordpress website to send me notifications about updates and logins.
There is a feature letting me know that people try to login as "Admin" and fail.
The thing is that all the IP addresses look a little bit the same and I have the possibility to block ranges of IP address.
I do not know how to spot patterns in IP addresses and wanted to know if anybody could tell me if there is a safe range to block from these addresses :
62.4.15.127
52.24.167.223
13.59.51.48
54.86.170.240
54.234.166.220
52.206.230.218
52.91.211.57
34.216.71.59
54.209.218.2
52.43.164.197
18.217.58.26
54.191.89.133
54.173.164.232
18.217.57.212
54.245.186.15
35.165.212.204
54.186.111.14
34.205.63.12
52.71.44.114
52.87.237.129
There is no clear pattern in those IP addresses. Some of them are from Amazon Web Services, others from other hosts. You can lookup where an IP address is from using IP lookup tools (google "IP Lookup tools"). One such site currently is: https://www.iplocation.net
As for patterns, you want to learn about IP subnets and IP CIDR notation. The simplest pattern is looking at the third block 1.2.3.4 or number 3, if 1, 2 and 3 are the same, they generally belong to the same subnet class. If number 3 is similar and 1 and 2 are the same, they may belong to the same CIDR block. When 1, 2 and 3 are all different, they belong to separate subnets. Digital Oceans has a site with more details at https://www.digitalocean.com/community/tutorials/understanding-ip-addresses-subnets-and-cidr-notation-for-networking
In similar questions, the question that has been answered is:
why do we need both MAC and IP addresses on the internet? They are
both addresses. Why can't one just be used to describe a device?
The answer is along the lines of:
The two protocols are not universal, not all devices use it. IP
provides a logical address and allows routing, MAC doesn't support routing, and more.
My new question is:
That's a nice answer as to why the internet as a whole needs both types of addresses, but why do we need Local IP addresses?
Locally, on the same network, no routing is involved, I'm simply sending to the computer next to me. Why can't I just send directly to his MAC address? And the router that connects our local network to the internet - why can't he just store a table of MAC addresses to keep track of what from the outside world goes where in the "local world"?
The existence of Local IP seems unnecessary.
So lets forget for a second that all modern OS's are primarily based on IP/IPv6 and your suggestion would completely break everything. Imagine this analogy:
An IP address is like a fully qualified postal address:
I. M. Ray
1024 Megabit Dr
Somecity, State 10101
Your MAC address is your physical house. The blue one 4 house from the corner, with the big oak tree.
When someone is sending you a letter conventionally, the mail is routed to your local post office based on the full address. We will compare this with routing of IP over the internet. The post office the mail was sent from could care less about your oak tree.
In the conventional method, the post man would organize his deliveries by street, and go house to house delivering the mail. This is similar to ARP table, we have organized the houses into an easy to find and navigate index.
In your proposed method, as soon as the mail arrives at the post office, they replace the envelope with your full address to one with a description of your house on it. It is now the post mans job to remember where the Blue house with the oak tree is.
So, while your thoughts are on the right track, they are just not practical. Once you are on the same layer 2 domain (local), then you don't necessarily need routing and could in theory use just physical addresses.
I am sorry if this is a pretty far out answer. I've been reading your other questions on the topic, and it seems as though you are trying to wrap your head around this subject, and this was my best attempt at breaking it down logically. The whole idea is pretty tricky to understand at first (we've all been there), but once you figure out the parts and the role they play in the grand scheme, the more it starts to make sense.
Please feel free to ask if you have any questions, as my primary intention of posting this is to actually help you out.
Is there any good book about networks and network protocols? One question I currently have is: How does the operating system determine the IP address of the router in a LAN?
I want to understand those basics. I know that I can look up most of the common protocols by searching for their respective RFC, but I don't even know which protocols are used for which purpose.
The operating system knows the ip address of the first router (default gateway), because someone told it - either manually when configuring the TCP/IP settings or dynamically via DHCP, BOOTP or similar.
There are plenty of good book suggestions in the closed question "What are good books on computer networks"
http://www.pearsonhighered.com/kurose-ross/
http://books.google.co.in/books/about/Computer_Networks.html?id=Pd-z64SJRBAC
Both are good books. Enjoy !!
First-timer on Stack Overflow here. I'm surprised nobody seems to have asked this question, and I hope this is the right place to ask this. I'm trying to determine if I should expect regular network switches (just simple switches, not routers) to have the capability to isolate local network traffic (i.e. targeted traffic that is directed to another local port in the ame switch) within the switch?
For example, if I have 2 machines connected to ports on the same switch (say, ports 2 and 3) and conversing using a directed, non-broadcast protocol (e.g. TCP), I wanted to make sure the traffic between these 2 machines are not forwarded the the rest of the network outside of the switched subnet.
I'm building a home network and I wanted to build private network "subnets" or "zones" using switches where local subnet traffic does not get forwarded to the "backbone" or the rest of the network. Note that I am NOT trying to block any inbound or outbound traffic to/from/between these "zones", but I just wanted to implement a "need to know" basis for these zones to limit network-wide exposure for localized traffic destined within the same switch. Specifically, I wanted the backbone to have as little unnecessary traffic as possible.
So back to the original question: is it fair to expect any network switch out there to be smart enough not to forward local traffic to the rest of the network? I would expect this to be the case, but I wanted to make sure.
PS: You can assume I have a DHCP/WINS server somewhere on the network that will be assigning IP addresses and the such.
I hope the question makes sense, and any help will be appreciated!
- K.
Short answer: yes, the switch is smart enough (otherwise it would be a hub).
And if you need fancy stuff you might have a look a VLANs.
And I believe this question belongs to serverfault or maybe superuser. That's probably why nobody asked it here :)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Given two computers attached to the Internet that know nothing about each other before hand, is it possible for one computer to be able to broadcast a message so that the second computer could receive it and respond?
I know UDP broadcast exsits, but I believe that those are generally filtered by the ISP before it reaches the true Internet. Is this true?
The current best way to achieve a multinode network without centralized coordination is through the use of Distributed Hash Tables. That link explains a bit and links to various implementations you can leverage.
That said, you still need each machine to coordinate with at least some peers. It's just that you don't need it to coordinate with a central server. A solution using a central server that know both (all) participating machines will also work, but imposes further restrictions on anonymity and scalability, just remember what happened to Napster.
You need an intermediate third party that they both know, that could distribute messages directed towards it in a broadcast-like fashion.
A solution for this problem (where none of your peers know the final address of the other) could be relying on IM protocols.
In particular, the XMPP protocol is extensible, open and used by many providers such as Google Talk. Libraries exist for most languages and it has the plus of being able to work (slowly and going through a 3rd party server) even if both hosts are behind a NAT-box.
If communication must use another channel, you can use XMPP to exchange IP address and then proceed with the standard socket route (but if you encrypt your messages, there should be no problem even going through a 3rd party server - to be true all packets go through untrusted 3rd party routers so you should encrypt anyway if you have sensitive data..).
Hope this helps.
No, you can't broadcast like that over the internet. You need to know which address you want your packets to go to.
A possible solution for you is to use a dynamic DNS service.
Your application would need to know in advance which hostname the other host will be using, but this service would at least get around the fact that you don't know exactly which IP address the other computer is on.
Note that this won't solve the potential issue of firewalls between the two hosts blocking your packets. The only practical way around that is for both hosts to open an outbound connection to a central host which can then relay data between them.
Look at the chord or pastry algorithm. It is an overlay network (DHT based) which has a discovery mechanism involved. It's a P2P (Peer 2 Peer) routing algorithm.
UDP is a dead end - its just a protocol where the order the packets are received is less important and there are issues routing over WANS. You said that you want to connect two computer on the "internet" presumably with the end points moving around etc. The only way is to use a central server as a register/directory. If each end point allso a web service or something and registeres its current IP address and name periodically then the other end point can look up the IP address of the other using this service. (could host your own DNS server and code your end point to register on this DNS?)
One of the problems is that even if you have the IP address what is one or more nodes are behind a firewall or NAT router ? You will need to host a server to proxy traffic. The best example is SKYPE - look into how it works it is documented, very interesting.
The simplist answer might be to jump on the back on an existing service such as messanger, skype, bit torrent, etc.
Simon
If the computers are running Windows, I'd look at using PNRP.
Multicasting is also a possible solution. It's certainly feasible in a corporate network