Re: NAT router confusion
- Original Message - From: Michael H. Semcheski [EMAIL PROTECTED] Date: Friday, June 24, 2005 1:46 am Subject: Re: NAT router confusion On Thursday 23 June 2005 07:43 pm, Ulf Magnusson wrote: Is this router really some switch/router hybrid? Or..? Bleh, someone please sort this out for me. I realize this isn't strictly FreeBSD-related, but I simply couldn't think of a better place to pick brains, so I hope I'll be excused :) It is a switch / router hybrid. If the traffic is going to an address on the same network, its a switch. If the traffic is going to an address on a different network, its a router. If you understand that concept, then you should have a pretty good idea of how the system works. I do not have a complete enough understanding of IP networks to explain this in specific detail. I think the key is that the computer generating the traffic looks at the netmask for the sending interface (eg, 255.255.255.0) and uses this to determine if the endpoint of the traffic is on the same network or not. If it is, it sends the traffic directly to the host. If it is on a different network, it forwards the traffic to the gateway address. Mike Thanks, I think I understand how it works now. I guess it's basically like an ordinary router that pretends it's a switch for all addresses that appear on the same local network. It looks at the destination address in IP packets and the address of the sending system and goes into switch mode if they both appear on the same subnet (which is pretty much verbatim what you said, when I think about it). I'll throw another short question in the mix while I'm at it.. perhaps I should rename the thread Switching/routing questions from a curious networking newbie :-) Do switches gain anything by having full-duplex connections to hubs? I understand there must be a performance benefit when you connect a host directly to a switch, but won't the half-duplex connections of the hosts to the hub become a bottleneck? Ulf ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: NAT router confusion
My understanding is that the netmask (255.255.255.0 as you put it) is only to determine how much of the IP address is used for the subnet address. I'm a newb with this as well, so please, someone correct me if i'm wrong. If your IP is 192.168.1.10 and your netmask is 255.255.255.0, then only the last 8 bits of your IP (the last .10) is usable for a specific host on the network and the first 24 bits are used for the network address and subnet address. In binary: ... would be your netmask and only the trailing 0's can be used for a host address. This could also be expressed as 192.168.1.0/24 using CIDR. Let me try to give you another example: if your IP range was 192.168.99.0 to 192.168.99.255 and netmask was 255.255.255.254 then, in binary, the netmask would look like this: 111...1110 Being that you are using 192.168.99.0 as the network address, the first three 1's in the last 8 bits of the netmask would be your subnet addresses. So you could use.192.168.99.32, *.64, *.96, *.128, *.160 and *.192 for subnet addresses and the IPs between all of those (except the last IP, so you can only assign 30 per subnet since the last IP is used for broadcast) can be assigned to hosts. Hopefully that (correctly) clears up any confusion involving subnets and netmasks. Like I said, I'm new at as well, so please correct me if I am wrong. - Original Message - From: Ulf Magnusson [EMAIL PROTECTED] To: freebsd-questions@freebsd.org Sent: Friday, June 24, 2005 6:25 AM Subject: Re: NAT router confusion - Original Message - From: Michael H. Semcheski [EMAIL PROTECTED] Date: Friday, June 24, 2005 1:46 am Subject: Re: NAT router confusion On Thursday 23 June 2005 07:43 pm, Ulf Magnusson wrote: Is this router really some switch/router hybrid? Or..? Bleh, someone please sort this out for me. I realize this isn't strictly FreeBSD-related, but I simply couldn't think of a better place to pick brains, so I hope I'll be excused :) It is a switch / router hybrid. If the traffic is going to an address on the same network, its a switch. If the traffic is going to an address on a different network, its a router. If you understand that concept, then you should have a pretty good idea of how the system works. I do not have a complete enough understanding of IP networks to explain this in specific detail. I think the key is that the computer generating the traffic looks at the netmask for the sending interface (eg, 255.255.255.0) and uses this to determine if the endpoint of the traffic is on the same network or not. If it is, it sends the traffic directly to the host. If it is on a different network, it forwards the traffic to the gateway address. Mike Thanks, I think I understand how it works now. I guess it's basically like an ordinary router that pretends it's a switch for all addresses that appear on the same local network. It looks at the destination address in IP packets and the address of the sending system and goes into switch mode if they both appear on the same subnet (which is pretty much verbatim what you said, when I think about it). I'll throw another short question in the mix while I'm at it.. perhaps I should rename the thread Switching/routing questions from a curious networking newbie :-) Do switches gain anything by having full-duplex connections to hubs? I understand there must be a performance benefit when you connect a host directly to a switch, but won't the half-duplex connections of the hosts to the hub become a bottleneck? Ulf ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: NAT router confusion
On Friday 24 June 2005 06:25 am, Ulf Magnusson wrote: Thanks, I think I understand how it works now. I guess it's basically like an ordinary router that pretends it's a switch for all addresses that appear on the same local network. It looks at the destination address in IP packets and the address of the sending system and goes into switch mode if they both appear on the same subnet (which is pretty much verbatim what you said, when I think about it). Its my understanding, and it is somewhat limited, that the host that is generating the traffic is really the one that determines whether the traffic needs to leave the network or not. The router functionality only kicks in if a packet is sent to the gateway (think of the gateway as another host on the network) and the destination is outside of the network. Do switches gain anything by having full-duplex connections to hubs? I understand there must be a performance benefit when you connect a host directly to a switch, but won't the half-duplex connections of the hosts to the hub become a bottleneck? By this question I'm a little confused. Switches are devices that allow a bunch of connections, and packets are routed from one interface to another within the switch. A hub is a device that allows a bunch of connections, and packets are more or less broadcast to every other interface on the hub. If you go to your local computer store, you will not be able to buy a hub. Maybe there are hubs sold for specific legacy applications I don't know about, but in the consumer market, they have not sold hubs in at least 5 years. I personally have never setup a hub, so I don't know whether there is something special about them that makes them half-duplex only. I do know that many ethernet flavors do not autonegotiate as well as we would hope. If you have a 100Mb half-duplex connection from a FreeBSD host to another host, try ifconfig fxp0 media 100baseTX media-opt full-duplex, which, assuming your NIC is fxp0 and my syntax isn't too rusty, will force the device into full-duplex mode. To connect to switches that do not autonegotiate correctly, one thing you can do is setup a FreeBSD host with two NIC's. Plug one switch into each NIC, and force each NIC to the right media type. Set up a bridge on the FreeBSD host, and voila, you have solved the duplex problem. We have this problem at work in some places. A switch we want to use does not autonegotiate full-duplex with the switch computing services provides. So, put a bridge in between and remove autonegotiation. Mike ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
NAT router confusion
I connect to the Internet through a NAT router serving two hosts, both with addresses on the same local network (192.168.0\24). How does this work? Can hosts connected to different router interfaces really be on the same network (provided the router is in the only path between the two systems)? What about broadcast messages on the network, aren't those blocked by routers? Does the router make an exception when it sees that the broadcast is for a network it is connected to through multiple interfaces (I noticed that only UDP packets sent to the network broadcast address, 192.168.0.255, propagate to all hosts, while packets sent to 255.255.255.255 don't)? Is this router really some switch/router hybrid? Or..? Bleh, someone please sort this out for me. I realize this isn't strictly FreeBSD-related, but I simply couldn't think of a better place to pick brains, so I hope I'll be excused :) Ulf ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: NAT router confusion
On Thursday 23 June 2005 07:43 pm, Ulf Magnusson wrote: Is this router really some switch/router hybrid? Or..? Bleh, someone please sort this out for me. I realize this isn't strictly FreeBSD-related, but I simply couldn't think of a better place to pick brains, so I hope I'll be excused :) It is a switch / router hybrid. If the traffic is going to an address on the same network, its a switch. If the traffic is going to an address on a different network, its a router. If you understand that concept, then you should have a pretty good idea of how the system works. I do not have a complete enough understanding of IP networks to explain this in specific detail. I think the key is that the computer generating the traffic looks at the netmask for the sending interface (eg, 255.255.255.0) and uses this to determine if the endpoint of the traffic is on the same network or not. If it is, it sends the traffic directly to the host. If it is on a different network, it forwards the traffic to the gateway address. Mike ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]