2006-10-26 Mary Nguyen Duy-Ky Nguyen, PhD
The number we are using daily is decimal number, there are only 10 digits to make up a number, they are 0, 1, ., 9
Computer is a digital electronic equipment. It's impossible to assign 10 electrical levels to 10 digits. It's only possible for only 2 levels, full voltage for digit 1 and no voltage for digit 0. For a 10-volt device, 10 v for 1; but 5 volt is for 1 in a 5-volt device.
That's why computer uses binary number where there are only 2 digits to make up a number, they are 0 and 1.
The number 2006 is a decimal number for this year, but its binary number is 11111010110.
It's almost impossible to read and very prone to error. That's why the hexadecimal (hex for short) number comes to rescue this problem. There are 16 digits to make up a hex number, they are 0, 1, ., 9, a, b, c, d, e, f. It's composed of 10 digits we're quite aware of and the first 6 characters in alphabetical set we're also quite aware of. Now the hex number of 2006 is 7d6, it's much easier to read than binary one, and even easier than decimal one.
There are 3 address types used to access Internet
Domain name address, aka URL (Uniform Resource Locator), like http://www.tramhungchau.com. This address is never changed, whenever I access to this web site whenever I use this domain address;
IP (Internet Protocol) address in number format, 98.130.165.236 is IP address of tramhungchau.com. An IP address is composed of Net_ID and Host_ID. This IP address is changed once ISP (Internet Service Provider) is changed for some reason (price, service quality, .). In fact, it's very likely that the IP address is a dynamic IP address changed very frequently;
MAC address, aka Physical or Ethernet address, in number format, 00:15:e9:77:e4:c4 is MAC address of tramhungchau.com. A MAC address is composed of Vendor_ID and Device_ID. Note that hex numbers are used. This address is changed once the HW network card is changed for some reason, like the card itself is broken and replaced, the server computer is changed.
We're using domain name address to access Internet because it's never changed and easier to remember a name tramhungchau.com than a number 98.130.165.236. But IP and MAC addresses are both used to access that web site as later explained in Routing section.
Below is the process whenever you want to access tramhungchau.com,
We should know some definitions in network literature
Data must go through many gateways from your PC to web site tramhungchau.com
Assume data go from host A (Src, source) to host B (Dst, destination) through gateway X and Y. Data are transferred across network along with addresses of both Src and Dst, with both MAC and IP addresses in packets.
To save typing and reading, address is implied whenever IP and MAC appear.
As mention earlier, a host is connected to 1 network, but gateway is connected to 2 networks.
IP_address = Net_ID + Host_ID
There could be many hosts connected to a network identified by its Net_ID. A subnet_mask is used to extract Net_ID from an IP_address.
Using DOS window (Command Console, .), we can use command
c:\> ipconfig /all
We'll see IP address, Subnet Mask and Default Gateway, something like
Windows IP Configuration
Host Name . . . . . . . . . . . . : DKN_WXP
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
net adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) PRO/1000 PM Network Connection
Physical Address. . . . . . . . . : 00-13-20-73-97-E6
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 11.1.1.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 11.1.1.1
DHCP Server . . . . . . . . . . . : 11.1.1.1
DNS Servers . . . . . . . . . . . : 11.1.1.1
Lease Obtained. . . . . . . . . . : Saturday, October 28, 2006 9:34:13 PM
Lease Expires . . . . . . . . . . : Sunday, October 29, 2006 12:34:13 AM
Tool completed successfully
So, using Subnet_Mask 255.255.255.0 to extract Net_ID 11.1.1 from IP_address 11.1.1.3.
Each ISP (Internet Service Provide) is assigned a Net_ID. There are a limit number of hosts connected to ISP network, but ISP may have number of customer more than number of host_ID allocated. For example, Net_ID has subnet_mask of 255.255.0.0, so up to 65536 hosts connected to the network. But it could have more than 65536 customers because it's very unlikely all customers connected to the network at the very same time. Hence, it's impossible to assign a static (unchanged) IP address to each customer PC. A dynamic (different) IP address is assigned whenever customer logs on to the network.
Notes on info above for this PC by command ipconfig /all,
Internet came from a project of Department of Defense for a reliable communication even in case of broken network attacked in a nuclear war. It's known as TCP/IP (Transmission Control Protocol / Internet Protocol). Using this protocol, data are divided and sent in small packets with sequence number. The receive side puts all these packets together based on the sequence numbers in order to restore the whole data. The reliability is based on the fact that the receiver will acknowledge every packet it gets. The transmitter will retransmits missing packet, ie. it does not get acknowledge for that packet from the receiver. There are many paths from a source to a destination, like our daily traffic. A packet goes through many gateway to arrive destination. Every gateway knows what path is fine and forward a packet via that path, like a sign at a join to ask us to use or not to use any road due to construction, for example. So, as mentioned in the section on Routing, a packet must contain
In our daily life, we're using some application protocols based on this reliable transmission protocol
All network transactions are based on server-client principle. Our side is a client, and the other side is server. For HTTP, the server is at the web site we're accessing, the client is the web browser we're using to access the web site.
Note that ISP assigns only 1 IP address to our connection once our PC is online.
It's very likely that we have more than 1 PC online at the same time, while we are given only 1 IP address. The only solution to this problem is to use router to create another network. As mentioned earlier that a router, aka gateway, has 2 network connections. The IPS IP is assigned to 1st connection, and the 2nd one is for a subnet with several PCs
Note that all the following utilities should be run in DOS window (command window, console window, .)
The most well-known network utility could be ping. When we are unable to access an Internet destination ( website, ftp, .), it could be the server down or the network communication is broken. Nothing we can do about the former case, but for the latter case, we can use ping utility to make sure our home network connections are fine
For a web site, we use
ping yahoo.com
Pinging yahoo.com [66.94.234.13] with 32 bytes of data:
Reply from 66.94.234.13: bytes=32 time=755ms TTL=55
Reply from 66.94.234.13: bytes=32 time=555ms TTL=55
Reply from 66.94.234.13: bytes=32 time=715ms TTL=55
Reply from 66.94.234.13: bytes=32 time=811ms TTL=55
Ping statistics for 66.94.234.13:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 555ms, Maximum = 811ms, Average = 709ms
The above test is possible if we have DNS setup, otherwise the utility ping does not know what is yahoo.com.
If we do not have DNS setup, we have use IP_addr of our home router
For our home router
ping IP_addr
Normally, IP_addrr is 192.168.0.1, or 192.168.1.1, or 192.168.2.1, .
Another helpful network utility is ipconfig. It could be use to get all network parameters, like IPAddr of our home router. We have seen ipconfig earlier.
ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : DKN_WXP
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) PRO/1000 PM Network Connection
Physical Address. . . . . . . . . : 00-13-20-73-97-E6
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 11.1.1.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 11.1.1.1
DHCP Server . . . . . . . . . . . : 11.1.1.1
DNS Servers . . . . . . . . . . . : 11.1.1.1
Lease Obtained. . . . . . . . . . : Saturday, November 04, 2006 4:54:56 PM
Lease Expires . . . . . . . . . . : Saturday, November 04, 2006 7:54:56 PM
Tool completed successfully
We then ping the router IP_addr, using data from ipconfig above
ping 11.1.1.1
Reply from 11.1.1.1: bytes=32 time<1ms TTL=127
Reply from 11.1.1.1: bytes=32 time<1ms TTL=127
Ping statistics for 11.1.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Tool completed successfully
Another interesting utility is TRACERT as it tells us know what path to reach a website
tracert yahoo.com
Tracing route to yahoo.com [216.109.112.135]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms 11.1.1.1
2 10 ms 9 ms 9 ms adsl-75-31-63-254.dsl.pltn13.sbcglobal.net [75.31.63.254]
3 9 ms 10 ms 9 ms dist1-vlan50.pltn13.pbi.net [64.164.97.66]
4 10 ms 21 ms 10 ms bb1-g3-0.pltnca.sbcglobal.net [151.164.43.54]
5 12 ms 11 ms 12 ms bb1-p3-0.crsfca.sbcglobal.net [151.164.190.85]
6 12 ms 13 ms 13 ms ex1-p14-0.eqsjca.sbcglobal.net [151.164.41.10]
7 13 ms 13 ms 12 ms asn10310-yahoo-10g.eqsjca.sbcglobal.net [151.164.248.58]
8 88 ms 88 ms 89 ms so-0-0-0.pat2.dcp.yahoo.com [216.115.101.150]
9 88 ms 88 ms 104 ms ge-0-0-0-p121.msr1.dcn.yahoo.com [216.115.108.11]
10 88 ms 88 ms 87 ms ge7-2.bas2-m.dcn.yahoo.com [216.109.120.197]
11 88 ms 88 ms 87 ms w2.rc.vip.dcn.yahoo.com [216.109.112.135]
Trace complete.
Tool completed successfully