The irony of this post is that, only a few days ago, I was singing the praises of the D-Link DSL-320B. Sadly, I was more than a little wrong. This modem has turned out to be a shocking piece of software engineeringWikipedia: Software engineering (SE) is the application of a systematic, disciplined, quantifiable approach to the design, development, operation, and maintenance of software, and the study of these approaches; ... and has stolen many hours of my life, that I will never get back.
When in 1483 Bridged IP mode, the modem was actually fine. It connected to the ISP and allowed the routing of a subnet over it. When I switched to a new ISP, which used PPPoA, the story was somewhat different. The setup is such that the PPPoA connection gets issued its own IP address, outside of the routed subnet, and then the subnet is routed over this. This modem implements a system called half-bridgingWikipedia: Network bridging describes the action taken by network equipment to allow two or more communication networks, or two or more network segments, to create an aggregate network. Bridging is distinct f...… in a horrible horrible way. A way which, in fact, kills kittens. Poor poor kittens.
When you first connect a computer to the modem, its DHCPWikipedia: The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to configure devices that are connected to a network (known as hosts) so they can communicate on that network using the Intern... server issues the computer with an IP address from the DHCP range – lets say 192.168.1.2. It also issues the computer with its own local address as the gateway – lets say 192.168.1.1. Once the PPPoA connection has established it re-issues the DHCP lease, giving the computer the public IP address (e.g. 126.96.36.199 ) as well as its local address as the gateway. As such, your IP configuration looks a little like this:
IPv4 Address. . . . . . . . . . . : 188.8.131.52
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 192.168.1.1
The more observant of you will be scratching your head with bewilderment now. The computer is now in a subnet all of its own, as dictated by the subnet mask, but is using an IP in an entirely different subnet as its gateway. It seems to use a system of sending ARPWikipedia: Address Resolution Protocol (ARP) is a telecommunications protocol used for resolution of network layer addresses into link layer addresses, a critical function in multiple-access networks. ARP was de... replies frequently, to ensure that the computer always knows the MAC address of the 192.168.1.1 host – since it won’t ARP for it itself. This didn’t seem to work with my BSD based router, which plain refused to add a gateway which was not on the same subnet. I don’t really blame it. It seems this modem was designed for Windows.
Anyway, the plot thickened further. To allow bridging, the modem uses a route which routes all packets out of the PPP interface. This route is only added after the second DHCP lease has been successfully issued. It does not appear to be possible, inside its interface or via telnet, to add this route manually. As such, it was possible to con the modem into working as a full bridge by using a Windows computer to get a DHCP lease and then connecting the modem to a network of devices which used IPs in the routed subnet. This was a poor solution as the DHCP lease expired every 10 or so hours, thus this process needed to be repeated frequently to get Internet connectivity back. Further to that, if you turned off the DHCP server, it was impossible to connect to the Internet using the modem in PPPoA mode.
As a side note, if you set the MTU of this modem’s PPPoA connection to 1500, it resets itself to factory settings. Useful, eh?
In the end, I opted to buy a Thomson Speedtouch 546 which works wonderfully.
The maximum transmission unit (MTU) is a term used in data networking and refers to the maximum size of a single data unit that can be transmitted across a specified medium. For example, the MTU of Ethernet, the most widely used protocol on the Internet, is 1500 bytes. That is to say that a single Ethernet frame cannot be larger than 1500 bytes.
The MTU represents a balance between efficiency through reduction of protocol overheads and the reduction of work if an error occurred. Thus, if the MTU is set too low, more data packets will have to be sent to represent a single bit of data. Each comes with its own headers and thus extra overhead. However, if the MTU is set too high and a transmission error occurs, the whole packet will have to be re-transmitted. It is also the case that larger packets are more likely to encounter errors – thus worsening the problem.
So how do networks of different MTUs communicate? In an IPv4 network, the mediums will simply fragment the data into multiple packets. For example, if the network was something like this:
Computer —– Ethernet Jumbo Frames (8000 bytes) —–> Router —– Ethernet v2 (1500 bytes) —–> ADSL Modem —– PPPoA (1492 bytes) —–> ISP Router —– Ethernet v2 (1500 bytes) —–> Server
This represents a network comprising of a number of different MTUs. The first computer is on a network which permits Ethernet Jumbo Frames at an MTU of 8000 bytes. It, thus, sends packets of a maximum size of 8000 bytes. Let say one of these packets is 6000 bytes in size. It will hit the first router which must send the packet to the ADSL Modem at an MTU of 1500 bytes. It will, thus, split the packet into 1500 byte chunks. This will likely be 5 packets, once the additional protocol data has been applied to each packet.
The ADSL modem is then restricted by an MTU of 1492 bytes to transmit data over the phone lines to the ISP’s router. It further fragments each packet, probably into 2 (making 10 total), to allow this transmission. The ISP’s router receives this packet and, although the next hop allows a higher MTU, it will not typically attempt to re-combine packets to get maximum efficiency.
So, the bottleneck of this network is the PPPoA communication over the phone lines. It could be eliminated by allowing a 1500 byte MTU. This is not something that any single party can do, rather both sides of the connection must agree to the MTU setting. BT’s 21CN network permits an MTU of 1500 bytes, however many ADSL modems are configured by default to use 1492. Upping this to 1500 will prevent certain fragmentation and thus increase throughput.
An IPv4 packet can set a flag to tell routers not to fragment it. If this is set and the packet is larger than a given MTU, the packet will not be sent on – rather a failure message will be sent.
In IPv6, the MTU of the entire transmission is determined using discovery protocols, by the sending host. This means that the host will never send a packet that is too large to transmit over any given part of the path between source and destination and it will thus never be fragmented. So, in our example above, the computer should never send a packet more than 1492 bytes. If it does, the packet will be dropped.
I’m canceling my BE contract and need to return the BE Box to them. I’m getting a VDSL2+Wikipedia: Very-high-bit-rate digital subscriber line 2 (VDSL2) is an access technology that exploits the existing infrastructure of copper wires that were originally deployed for traditional telephone service a... connection with an ADSL2+Wikipedia: ITU G.992.5 is an ITU (International Telecommunication Union) standard, also referred to as ADSL2+ or G.DMT.bis+. Commercially, it is notable for its maximum theoretical download speed of 24 Mbit/s. backup, for which I needed a standard ADSL2+ modemWikipedia: A modem (modulator-demodulator) is a device that modulates an analog carrier signal to encode digital information, and also demodulates such a carrier signal to decode the transmitted information. The... for. Because it was going cheap on eBay, I went with the D-Link DSL-320B. This is actually a really good modem in such that it has a decent web interface supporting many different types of connection as well as telnetWikipedia: Telnet is a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. User data is i... access to a powerful command line to do things like static routes.
To configure a modem such as this on BE Unlimited, you need the following settings:
Type: 1483 Bridged IP LLC
Note that this is NOT PPPoATMWikipedia: The Point-to-Point Protocol over ATM (PPPoA) is a network protocol for encapsulating PPP frames in AAL5. It is used mainly with DOCSIS and DSL carriers. or PPPoEWikipedia: The Point-to-Point Protocol over Ethernet (PPPoE) is a network protocol for encapsulating PPP frames inside Ethernet frames. It is used mainly either: and, as such, doesn’t require a username/password.
Following this, you can then assign your router your issued static IP address(es), or set its WAN interface to use DHCP, if you have a dynamic IP.
My DSL-320B reports the cable status as being “Up” but the ADSL status as being “disconnected”. I assume that this is because it has not dialed a connection. It works fine, despite this.
My sync rates with the new modem are about what they were before:
Downstream Line Rate (Kbps) : 17301 Upstream Line Rate (Kbps) : 2342
My speedtest.net results show higher upstream than before, however this may just be the way the cookie crumbled with the speed test:
VLANs are a feature of almost all managed network switchesWikipedia: A network switch is a computer networking device that links network segments or network devices. The term commonly refers to a multi-port network bridge that processes and routes data at the data link.... A managed switch will allow you to assign ports to VLAN groups. Devices in one VLAN will not be able to directly communicate with devices in another VLAN. In simple terms, creating VLANs is a bit like splitting a switch into multiple smaller switches.
Why would I buy an expensive managed switch when I could just buy multiple cheap unmanaged switches, I hear you ask. Well, a port can be assigned to multiple VLANs. If you wanted to, for example, break 192.168.0.1/24 (254 usable IP addresses) into 2 groups of 192.168.0.1-192.168.0.100 and 192.168.0.101-192.168.0.254 you could create 2 VLANs, one for devices in each IP range. You could then have an administrative terminal connected to a switch port which is in both VLANs. This administrative terminal can then access devices in both IP ranges.
So what is 802.1Q VLAN tagging? Well, it allows a single port to access multiple VLANs, even if devices in each VLAN are in a different IP subnet. For example, if your network had two departments one which used 192.168.0.1/24 and the other which used 10.1.1.1/24, you could create two VLANs as described above. You could then create a 802.1Q VLAN tagged port on the switch and connect a device such as an administrative computer or a router into it. You would then configure the administrative computer or router to assign it 2 IP addresses (for example 192.168.0.100 and 10.1.1.100) and associate each IP with the correct VLAN. Every packet of data that is sent from the router to the switch would tell the switch which VLAN it is for (and visa versa).
Here is an example usecase for 802.1Q VLANs:
A switch has 3 VLANs on it…
- Ports 1-4 :: Internet facing devices such as the modem and servers
- Ports 5-14 :: Devices in the finance department
- Ports 14-20 :: Devices in the HR department
In ports 1-4 (VLAN1) we have connected the modem and a Linux server. These have public IP addresses in the 184.108.40.206/28 range. In ports 5-14 we have connected PCs in the finance department which have private IP addresses in the 192.168.1.0/24 range. In ports 14-20 we have devices in the HR department which have private IP addresses in the 10.0.1.0/24 range.
Port 21 is 802.1Q VLAN tagged with access to all 3 VLANs. Into this port, we have connected a router. This router has an IP address for each VLAN (192.168.1.1, 10.0.1.1 and 220.127.116.11). The router routes packets between the three VLANs to give private IPs access to the Internet, using NAT, as well as routing packets between the two private subnets to give the HR department access to files in the finance department and visa versa.
This idea was actually raised by @sicoanimal but I thought I should blog about it anyway.
Elastic IP Addresses on Amazon EC2 are free… unless you don’t use them. This is a strange business model but it prevents people assigning themselves IP addresses which they don’t use. For every complete hour an Elastic IP Address goes unassigned, you pay $0.01. This adds up to about $7.50 a month. This is a non-ideal pricing structure if, like me, you use EC2 to perform an hour or two of automated processing each day and have the instance shut down for the rest of the time.
However… you can get a Light Utilization Reserved Instance (micro) for $23 per year (or $35 for 3 years). This works out at less than $2 per month. You can assign your unused Elastic IP to a low cost micro instance such that it’s always in use and thus avoids the non-usage fee.