# I don't really understand how to set up a network

I am studying for an exam but I'm not sure I understand everything. I'm trying to work with an example, but I need someone to confirm that I'm doing it right.

R <- Router

PC <- Number of pc(s) connected to this router

N <- Network (for ip allocation purposes)

# Let's say I have:

• IP - 192.65.30.0

That means I have 256 IP's within 192.65.30.0 - 192.65.30.255. I will divide this into several smaller sub-networks, each with a network / broadcast IP (but I still have 256 IPs to work with, I don't need a network IP / Broadcast IP for the whole thing - picture - do I?)

When I allocate IPs I need to remember that the first one is the network IP, the last one is the broadcast IP (No network should need anything else reserved ? right ?)

First we'll ignore R5, I'll have more questions about that one later.

N1 = 3 IP, 1 Broadcast, 1 Network. Does network mean router IP ? Or do I also need router IP ? If so, I'll set this up as a /29:

• 192.65.30.0 -> network
• if I need a router IP where does it come in ? will it be 192.65.30.1 or is network ip == router ip ?

N1 = 3+2+1 = 6 => /29

N2 = 6+2+1 = 9 => /28

N3 = 90+2+1 = 93 => /25

N4 = 2+2+1 = 5 => /29

N6 = 3+2 = 5 => /29 (does this also need +2 - network / broadcast ?)

N7 = 2+2 = 4 => /30

Have I missed anything ? I know I have enough IPs to do this, but is it right ?

Also if I have R5, is it possible to add them somehow using fake IPs ? (I don't know the english word 10.0.0.0 is what I'm talking about) since the network connects to the internet trough R3. If you do answer this last question I'd really appreciate it if you could. I don't really understand Address Resolution Protocol, not even sure if that's what's supposed to be going on here.

-
1) This link might be useful. 2) "using fake IPs ? (I don't know the english word 10.0.0.0". See RFC1918 for private IP address space. (which is not fake at all). –  Hennes Jun 15 '13 at 19:12
@Hennes I've tried to explain that I can't find the word, in my language it translates ONLY to fake. Ty for the link, I'll study it in detail! –  Kalec Jun 15 '13 at 20:33
I think the word your looking for is 'private'. IP addresses defined in RFC1918 are considered private, in that they will not be resolved on the internet. as for the +2, yes, every network should reserve the lowest and highest values in the subnet address range for network ID and Broadcast. some hardware requires it (cisco) and others don't, but its a good idea to leave those free either way. –  Frank Thomas Jun 15 '13 at 21:57
keep in mind, since you are subnetting the network, you actually have both 1 network and many networks at the same time, depending on where you are when you ask the question (routers on the internet would see only 1 network). .30.0/24 is as much a network as 30.8/29 is, so yes, it needs ID and broadcast. No, the router internal interface is not the same as the ID. the router usually gets the lowest or highest IP in the range once the ID and BC are taken away. –  Frank Thomas Jun 15 '13 at 22:05
network IDs and Broadcasts are used only for routing decisions. you can run 'route' (linux) or 'route print' (windows) to see the routes your PC knows to other networks. this is the only place IDs and Broadcasts have meaning. .30.0 is never a host, but to a host on the internet that address can be used to determine the route to any address within .30.0/24. if N2 wanted to contact N1, it would have a route to .30.1/29, and would send packets addressed to .30.3 according to the instructions for that route. –  Frank Thomas Jun 15 '13 at 22:08

1) yes, all networks allocate an ID and a broadcast. It is impossible to route traffic to a network without an ID, and many protocols use broadcasts. IDs and Broadcasts are not options you select, but instead are calculated based on your address/subnet mask, so the hardware assumes all networks have them.

2) you are correct, there are no other reserved addresses within a standard network. There are reserved networks, but not host addresses, other than ID and broadcasts.

3) yes the router needs an IP, and it cannot be the network ID (no host can use the network ID). it is convention however that the gateway for the network be either the first or last valid IP in the range.

4) yes, N6 will have an ID and broadcast address. remember, IDs and broadcasts are things the devices assume are there. if they are occupied by hosts, or are overlapped by incorrect subnetting, errors will occur.

5) yes you can use 'private' or 'fake' IPs for any of the networks on your diagram. personally I would use a class B (172.16.0.0) for your whole network, so I could allocate an entire class C network to each of your zones.

6) Address Resolution Protocol (ARP) is used to discover the mapping of IP address to MAC address. when a host wants to send a packet to another systems IP address, the packet gets encapsulated in a Layer 2 Frame, so the host uses ARP to discover what MAC the frame should be addressed to, but its always a MAC on the local network, even if the IP address is for a remote network. ARP is not something you are worried about at this level of design, and its pretty much fully automatic.

The thing I think you are looking for is IP Routing. Routing is the process by which a router decides how to send a packet to the remote network its destined for.

for instance, lets say you addressed N5 with 10.1.1.0/24, N8 with 192.65.30.30/30, and N7 with 192.168.30.34/30. Some host in N3 wants to send a packet to a host in N5 (10.1.1.5). N3's gateway is R3, so the sender addresses a packet to 10.1.1.5 and sends it to R3. R3 receives the packet on N3's interface, and looks at its route table. it finds a route for 10.1.1.0 that looks like this

``````Destination  Mask            Gateway         interface     metric
10.1.1.0     255.255.255.0  192.168.30.36   192.168.30.35   3
``````

So, R3 knows that to reach 10.1.1.0 it must send the packet to R4, out its interface on N7. R4 receives the packet on its N7 interface (192.168.30.36), and notes that the packet is for 10.1.1.0/24. R4 looks at its route table and finds

``````Destination  Mask            Gateway         interface     metric
10.1.1.0    255.255.255.0   192.168.30.32   192.168.30.31   2
``````

R4 sends the packet out its N8 interface (192.168.30.31) to R5 at 192.168.30.32. R5 receives the packet on its N8 interface, and notes that it is destined for 10.1.1.0/24. It checks its route table, and finds

``````Destination  Mask            Gateway   interface     metric
10.1.1.0    255.255.255.0   10.1.1.1    10.1.1.1      1
``````

R5 sends the packet out its N5 interface (10.1.1.1) to the host 10.1.1.5.

you can learn much more about routing here:

http://www.faqs.org/docs/linux_network/x-087-2-issues.routing.html

http://www.eventhelix.com/RealtimeMantra/Networking/ip_routing.htm

there are lots of protocols that allow routers to work together to build route tables, like RIP, OSPF, IGRP, BGP, etc, so look those up once you have the basics down.

-