text:
Operating System Design/Process

A process is more than just a copy of a program in memory. An executable program is like a recipe. It's a series of instructions which the computer reads in order to accomplish a task. When a cook prepares a dish, he reads the recipe, gathers all the materials the recipe calls for, and combines them as the recipe dictates. This is similar to the way that a program is run.

When you run a program on your computer the operating system gathers resources (like memory and CPU time) and begins following the instructions listed in the executable. The OS must keep track of which instruction it's performing at any given moment, and the current state of the program. All of this information, including the program itself, the list of resources allocated to it, and its state information, are part of a process.

In multi-tasking operating systems, like Windows (95 and later), Linux, and MacOS, multiple processes can be run by the operating system at the same time, with each process taking turns running on the CPU. The operating system allocates time for each process to run on the CPU, and switches between each so quickly that they appear to run simultaneously. MS-DOS, which preceded Microsoft Windows, only ran one process one at a time.

Processes are used to carry out every task that needs to be performed by the computer. The operating system itself is a process. It spawns (or starts) processes that run the display, interact with the keyboard, run the mouse, and interact with disk drives. There are processes that are started by the user such as word processors, spreadsheets, web browsers, and e-mail clients. Some of these programs consist of multiple co-operating processes; for example, a web server might have multiple processes to handle multiple incoming requests at the same time.

Interprocess Communication
Of interest when designing an Operating System is Inter-Process Communication, or IPC. Essentially, when more than one process is running and sharing the same computer, there might be times when the processes need to communicate with another process or multiple processes might want to share the same resource. When this happens, care should be taken not to create certain dangerous conditions, namely, race conditions, where two processes attempt to use the same resource at the same time. Which ever is fastest gets first crack at it, but the other process then gets next crack and so on, confusing the resource. A deadlock occurs when two devices both lock into a waiting mode, waiting for the other to complete before they start, and so neither can complete, and other rarer and less predictable errors that are even harder to debug can occur as well.

The main problem is that processes to control processes take time, and during that time, another process can attempt to use the same resource. To run many processes concurrently requires that at no time can a resource be accessed by more than one process, and that while a resource is being locked for access, another process can't interrupt the processing and interfere with it. One way of keeping this from happening is to build commands into the hardware that are atomic, and can't be interrupted while they are critically involved with a resource. A number of such processes have been experimented with including locks, semaphores, mutexes, monitors, etc. The latest technique is a technique called Message passing that works well with OOP.

Threads
Although threads are sometimes not considered real processes because they do not carry all the heavy freight of a full process, concurrency using threads is just as fraught with problems as Inter-Process Communication. The primary difference is that a thread does not attach all the resources that a full process must. The specific difference lies in the CONTEXT fields of the process. Instead of having their own context, threads inherit the context of the main process, they were spawned from, and so care must be taken that they do not change variables used by other threads without some communication synchronization happening.

Threads are sometimes called lightweight processes. Both processes and threads provide an execution environment, but creating a new thread often requires fewer resources than creating a new process.

Threads exist within a process — every process has at least one. Threads share the process's resources, including memory and open files. This makes for efficient, but potentially problematic, communication.

Multithreaded execution is an essential feature of the Java platform. Every application has at least one thread — or several, if you count "system" threads that do things like memory management and signal handling. But from the application programmer's point of view, you start with just one thread, called the main thread. This thread has the ability to create additional threads, as we'll demonstrate in the next section.

title: Operating System Design/Process


text:
Hebrew/Lesson formats

Some text to describe this lesson. Include prerequisites. May want to say something about the level of the lesson. For basic or introductory level lessons, have as few prerequisites as possible.

Vocabulary
Try to have 10-20 new words. Words from prerequisite lessons may be included in the vocabulary section and not count as one of the 10-20 new words.

Enter vocabulary words by part of speech using the Hebrew-Large template or the Hebrew-Vocab template.

-- translation transliteration

For letters, special words, verb roots, etc. you can use the Hebrew-Huge template.

Use the ḥ for chet (sounds like the ch in Bach).

For more advanced lessons, you can use the regular size Hebrew template.

Point out related words, for instance ones with the same root that were in earlier lessons.

Phrases
And maybe include some common phrases.

Dialog
Vocabulary in use

Integrate content from prerequisites.

Special Notes
usage hints (modern versus prayerbook Hebrew, colloquial use, more polite forms)

explanations of things that might be confusing

points of interest

Exercises
With link to answers. By default, the name of the answers page is the lesson plus /Answers. So the answers for "this lesson" would be at Hebrew/Lesson formats/Answers.

Integrate content from prerequisites.

Translations.

Fill in the blank.

Match vocabulary to the right term - translation or transliteration (how it's pronounced).

Practice without diacritic marks.

Related Lessons
Lessons on similar topics, for instance Hebrew/Meals on the Hebrew/Food lesson.

Prerequisite or more advanced lessons, for instance Hebrew/Family2 on the Hebrew/Family lesson.

If this lesson is part of a set with an order, give the previous and next lesson.

Add to the Hebrew category.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Hebrew/Lesson formats


text:
Cookbook talk:Lemon Meringue Pie (British)

As an American, there is much here that I don't understand. I figured out that "digestive biscuits" are what we call "graham crackers." I don't know what "caster sugar" is? Is it what Americans call "powdered sugar" or "confectioner's sugar"? (Those terms mean the same.) What size "tin" (we would say "can") sweetened condensed milk? What is a "moderately cool oven" in degrees? (Please be sure to label whether Celsius or Fahrenheit, or, better yet, give in both.) Thanks to anyone who clears this up. -- Anne, 14 Oct 2006

I've added a few extra terms to the cookbook. Caster sugar is standard sugar used for making cakes but I have no idea what the US word is for this. Temperatures are in celcius and measurements are (or should) be in cm as that is what everyone except the USA and older British people use and moderately cool even is just a tad ambiguous so we'll see if the author can help there. Xania 21:34, 14 October 2006 (UTC)

Temp?
This could use a specific temperature, for people like me who are baffled by "cool oven." Jessicapierce 00:33, 3 May 2007 (UTC)

150-180 degrees Celsius works well. There is some choice in this range: higher temperature for less time produces a meringue which is slightly crunchier; cooler for longer makes it stickier.

Necessary?
Personally I have had lemon meringue pie quite a few times and don't think this is a british recipe version of it but a "cheats" recipe of a quick version. A very typical example of a real British lemon meringue pie can be found on delia smiths home page. Her recipe is outstanding and always produces fantastic results.

-> I think that this recipe may actually originates from South Africa, via the American dish of Key Lime Pie. As you say, it's not a "canonical" version of LMP, but it is very delicious.


text:
User talk:Supernik87~enwikibooks

Welcome to Wikibooks. Enjoy your stay here and don't be afraid to ask for help from other users if you need it. Xania 21:38, 14 October 2006 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Supernik87. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Supernik87~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:44, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:34, 19 April 2015 (UTC)

title: User talk:Supernik87~enwikibooks


text:
Talk:The Cold War/Introduction

Is this introduction not a little biased in favour of the USA? You mention that the USA had free elections and politicians could be elected irrespective of being left or right wing. What about the US's treatment of communists in the USA and their treatment of black people? Xania 22:06, 14 October 2006 (UTC)
 * Actually, it's way biased in favor of the Soviets. Xania seems to think that 40 million dead is the moral equivelent of ten liars going to jail for a short time. The Soviets started the Cold War long before World War II was over and engaged in massive espionage. Regarding "the US's treatment of communists in the USA" -- Communists who said they were communists and didn't engage in spying never had any trouble with the government although a lot of people wouldn't hire them. The so-called "Hollywood Ten" etc. simply lied under oath and some went to jail for a few days, weeks, or months. That's it. I knew a lot of communists. All through the Cold War, they had a building in New York, had chapters all over the country, and were entirely legal.

Regarding responsibility for the Cold War, declassified Soviet archives settled that score the moment the red flag fell from the Kremlin. They did it.Scott Adler 09:00, 25 October 2006 (UTC)

title: Talk:The Cold War/Introduction


text:
Communication Networks/Ethereal

Ethereal
Ethereal is a network packet analyzer or a “packet sniffer” as it is called. It was started by Gerald combs in 1997 to track down network problems. Since then Ethereal has been used as the main tool to track and manage network problems and also for R & D purposes.. Ethereal captures network packets from the network during a live network data transmission and gives a detailed summary or description about the packets such as its source and destination, protocols used, packet parameters, network standard, checksum, ports information and much more.

Ethereal is widely used in the networking field as it has many features. some of them are as follows. And many more.
 * Runs on many platforms such as Windows and Unix.
 * Captures live data packets and gives detailed information.
 * Saves all the information to be reviewed later.
 * Filters packet search on many criteria.
 * Supports around 780 protocols.
 * Gives detailed summary and statistics after capturing.
 * Moreover it is an open software.

Ethereal does not detect or troubleshoot the network problems, but it is very important for network management and security as it keeps track of all the packets sent to and fro from your network interface.

Getting started

 * Getting ethereal

Ethereal is a freeware. Simply download the Ethereal installer from: http://www.ethereal.com/download.html#releases and execute it.

After installing the ethereal package we start it to capture packets. The Ethereal’s Menu options are vast and covers almost all the aspects or options of packet capturing. The basic options of File, Edit, View, etc. have their usual functions. We will go in to the details of the menu afterwards. Let's start capturing packets, because then only you will grasp the real sense of using it. In the menu there is a Capture option. If we click on that button it asks for other options which are essential to both start and customize data capture.

Some of the options under capture tab are:

 * Interface: This menu item brings up a dialog box that shows what's going on at the network interfaces Ethereal knows of and we can select our desired interface and capture data on that particular interface.
 * Options: This the most important of all the dialog boxes. This menu item brings up the Capture Options dialog box and allows you to start capturing packets. It has all the main options that are required for any packet capturing. It allows you to capture data in promiscuous mode, assign some capture filter, specify capture file where captured packets are to be stored, specify name resolutions and lot lot more. The capture options window is self explanatory and guides you through the various options and gives information about them. The options window is shown below.

Start: It helps to start capturing data immediately with previous settings.

Capture Filters: This menu item brings up a dialog box that allows you to create and edit capture filters which helps you to be more specific with your data capturing.. You can name filters, and you can save them for future use.

After specifying all the options we can start capturing data. when the capturing is stopped then the detailed information is displayed in form of three panes. Which are as follows:

 * 1) The Packet List pane:    The packet list pane displays all the packets in the current capture file. Each line in the packet list corresponds to one packet in the capture file. If you select a line in this pane, more details will be displayed in the "Packet Details" and "Packet Bytes" panes. This pane gives information regarding the time, destination and source address, protocol used and any other additional information.
 * 2) The packet details pane:  The packet details pane shows the current packet (selected in the "Packet List" pane) in a more detailed form. This pane shows the protocols and protocol fields of the packet selected in the "Packet List" pane. The protocols and fields of the packet are displayed using a tree, which can be expanded and collapsed
 * 3) The packets bytes pane:   The packet bytes pane shows the data of the current packet in the hexdump form. When we select some message in the packet list pane, corresponding information is displayed in the other two panes. All types of descriptions on the various topics related to any data capture are provided in these three panes. Let’s explain this by taking an example.

References: http://www.ethereal.com/docs/

Example 1 - Capture of yahoo messenger
Below is just an explanation of the ethereal capture of the Yahoo messenger. It takes you through all the basic steps and explains each and every step as detailed as possible.Yahoo messenger use client/server technology for communication. The protocol it uses is yahoo messenger protocol. The yahoo protocol is a application layer protocol, which run over the HTTP and TCP.

Yahoo messenger protocol header
The yahoo messenger protocol header is shown below. Each yahoo messenger messages start with the following data format.

HTTP and yahoo messenger protocol header sample

The server acts as a proxy between two clients. All communications between clients go through the server.

Client A < -- > server < --- > client B

The client and the server both use connection oriented method to establish connection between each other. They use TCP for the same. When the connection is established, they use HTTP protocol to send and receive data. The data portion in the HTTP protocol contain the Yahoo messenger messages. This is decoded by both the server and the client.

When I try to connect to yahoo using yahoo messenger, the following processes happen in the background.
 * 1) PC gets the yahoo.com IP address from the DNS server.
 * 2) Using the yahoo IP address PC establishes a TCP connection to the yahoo server.
 * 3) Then PC sends the yahoo login message through HTTP protocol.

A sample HTTP protocol and yahoo messenger protocol message captured through ethereal is shown below

0000 00 13 10 d4 d7 56 00 0e  9b 7a af 62 08 00 45 00   .....V.. .z.b..E. 0010 02 61 0f 15 40 00 80 06  8b 84 c0 a8 01 ca d8 9b   .a..@... ........ 0020 c2 ef 05 6f 00 50 56 bf  09 3e 08 57 9f dd 50 18   ...o.PV. .>.W..P. 0030 ff f0 75 82 00 00 50 4f  53 54 20 2f 6e 6f 74 69   ..u...PO ST /noti 0040 66 79 2f 20 48 54 54 50  2f 31 2e 31 0d 0a 52 65   fy/ HTTP /1.1..Re 0220  6f 6e 74 72 6f 6c 3a 20  6e 6f 2d 63 61 63 68 65   ontrol:  no-cache 0230 0d 0a 0d 0a 59 4d 53 47  00 0e 00 00 00 25 00 57   ....YMSG .....%.W 0240  00 00 00 00 7a 40 00 00  31 c0 80 70 75 73 75 6b   ....z@.. 1..pusuk 0250 75 c0 80 30 c0 80 70 75  73 75 6b 75 c0 80 32 34   u..0..pu suku..24 0260 c0 80 36 33 35 39 37 39  35 38 32 c0 80 0d 0a      ..635979 582....
 * other http packets
 * other http packets

The yahoo messenger protocol is the data portion of the HTTP protocol. The yahoo messenger protocol starts with the header YMSG.

Yahoo messenger protocol background process using ethereal The following explains a simple communication between the yahoo client and yahoo server. In this case client A send a message to client B, where client B is offline. Each process is explained with packet capture using ethereal.

Login process

 * Client A log in to yahoo messenger.

1. When client A submits the login button of the yahoo messenger with his user id and password the following happens between the client ( Client A yahoo messenger) and yahoo server. Client A says	I want to login as here is the session id ‘7a 40 00 00’ and user name pusuku

0230  0d 0a 0d 0a 59 4d 53 47 00 0e 00 00 00 25 00 57  ....YMSG.....%.W 0240   00 00 00 00 7a 40 00 00 31 c0 80 70 75 73 75 6b  ....z@..1..pusuk 0250  75 c0 80 30 c0 80 70 75 73 75 6b 75 c0 80 32 34  u..0..pusuku..24 0260  c0 80 36 33 35 39 37 39 35 38 32 c0 80 0d 0a     ..635979582....

7a 40 00 00 is the session id, Client sents a YAHOO_SERVICE_AUTH (00 57) with status YAHOO_STATUS_AVAILABLE(00 00 00 00)

2. Server responds, Okay , Here is a challenge string , Using this to hash your id and password and send it to me

0170  00 00 59 4d 53 47 00 00 00 00 00 59 00 57 00 00  ..YMSG.....Y.W.. 0180  00 01 7a 40 00 00 31 c0 80 70 75 73 75 6b 75 c0  ..z@..1..pusuku. 0190  80 39 34 c0 80 64 7c 67 2d 75 5e 77 2f 79 2d 72  .94..d|g-u^w/y-r 01a0  2b 38 2b 70 2a 6b 2a 7a 2f 61 2d 35 2b 33 2a 62  +8+p*k*z/a-5+3*b 01b0  26 68 25 32 2a 75 2f 6e 2f 28 77 2d 70 2d 75 25  &h%2*u/n/(w-p-u% 01c0   71 2a 76 7c 7a 2a 6e 25 66 2f 67 2a 6e 7c 74 25  q*v|z*n%f/g*n|t% 01d0   79 26 6d 26 6d 29 c0 80 31 33 c0 80 32 c0 80     y&m&m)..13..2..

Server responds with YAHOO_SERVICE_AUTH (00 57) and status YaHOO_STATUS_BRB and the challenge string in the data portion of the yahoo messenger protocol

3. Client says,  here is the user id and password hashed with the challenge string

01f0  6c 3a 20 6e 6f 2d 63 61 63 68 65 0d 0a 0d 0a 59  l: no-cache....Y 0200   4d 53 47 00 0e 00 00 03 2f 00 54 00 00 00 0c 7a  MSG...../.T....z 0540  c0 80 0d 0a                                      ....
 * other hashed messages
 * other hashed messages

Client sends a YAHOO_SERVICE_AUTHRESP (00 54) with user and password hashed with the challenge string, The hashed challenge string is sent as data portion

4. Server verifies the user id and password and responds, okay your authenticated , here is your buddy list

0170  00 00 59 4d 53 47 00 00 00 00 03 c7 00 55 00 00  ..YMSG.......U.. 0180  00 05 7a 40 00 00 38 37 c0 80 43 68 61 74 20 46  ..z@..87..Chat F 0190  72 69 65 6e 64 73 3a 63 6c 75 6d 73 79 64 72 65  riends:clumsydre 01a0  61 6d 73 2c 64 75 72 67 61 6b 73 2c 6b 69 72 75  ams,durgaks,kiru 0510  31 38 35 c0 80 63 6c 75 6d 73 79 64 72 65 61 6d  185..clumsydream 0520  73 2c                                            s,
 * other buddy list and their status
 * other buddy list and their status

Server on authentication responds with the buddy list YAHOO_SERVICE_LIST (00 55) With this Client A is ready is ready to send the message to Client B, Tough client A knows , Client B is offline client A sends a offline message.

Send process
As Client A select Client B window and start typing, 1. The Client says, I am typing message for my buddy

0230  0d 0a 0d 0a 59 4d 53 47 00 0e 00 00 00 4a 00 4b  ....YMSG.....J.K 0240   00 00 00 16 7a 40 00 00 34 39 c0 80 54 59 50 49  ....z@..49..TYPI 0250  4e 47 c0 80 31 c0 80 70 75 73 75 6b 75 c0 80 31  NG..1..pusuku..1 0260  34 c0 80 20 c0 80 31 33 c0 80 31 c0 80 35 c0 80  4.. ..13..1..5.. 0270  64 73 75 73 61 69 c0 80 30 c0 80 70 75 73 75 6b  dnunai..0..pusuk 0280  75 c0 80 32 34 c0 80 32 31 33 31 30 33 33 39 33  u..24..213103393 0290  c0 80 0d 0a                                      ....

client sends YAHOO_SERVICE_NOTIFY(00 4b) message saying pusuku is sending message to dnunai with the status YAHOO_SERVICE_TYPING (0x16)

2. When the user presses the send button. The client sends the message to the server client send this message to my buddy server

0230  65 0d 0a 0d 0a 59 4d 53 47 00 0e 00 00 00 5c 00  e....YMSG.....\. 0240  06 5a 55 aa 56 7a 40 00 00 31 c0 80 70 75 73 75  .ZU.Vz@..1..pusu 0250  6b 75 c0 80 35 c0 80 64 73 75 73 61 69 c0 80 31  ku..5..dnunai..1 0260  34 c0 80 68 69 20 64 65 6c 6c 61 c0 80 39 37 c0  4..hi kella..97. 0270  80 31 c0 80 36 33 c0 80 3b 30 c0 80 36 34 c0 80  .1..63..;0..64.. 0280  30 c0 80 32 30 36 c0 80 32 c0 80 30 c0 80 70 75  0..206..2..0..pu 0290   73 75 6b 75 c0 80 32 34 c0 80 32 31 33 31 30 33  suku..24..213103 02a0  33 39 33 c0 80 0d 0a                             393....

client sends YAHOO_SERVICE_MESSAGE(00 06) message to the server The server processes the message, The message is from pusuku to dnunai(who’s status is offline, 5a 55 aa 56) Note the message sent ‘ hi kella’ Since Client B is offline, the server stores the message and sends it to client B , when client B log in. Now, client A has sent the message, time to logout.

Logout process
1. Client A says, I am done , I am logging out.

0230  0d 0a 0d 0a 59 4d 53 47 00 0e 00 00 00 1a 00 02  ....YMSG........ 0240  00 00 00 00 7a 40 00 00 30 c0 80 50 55 53 55 4b  ....z@..0..PUSUK 0250  55 c0 80 32 34 c0 80 32 31 33 31 30 33 33 39 33  U..24..213103393 0260  c0 80 0d 0a                                      ....

client sends YAHOO_SERVICE_LOGOFF(00 02) message to server

2. Server responds, okay.

0170  00 00 59 4d 53 47 00 00 00 00 00 00 00 02 00 00  ..YMSG.......... 0180  00 00 7a 40 00 00                                ..z@..

Server responds with empty message with service YAHOO_SERVICE_LOGOFF

Understanding Tracert with Ethereal
Tracert is a windows based tool for tracing the path of the packets taken from your pc to the destination router. This assignment traces the path from my pc to www.yahoo.com using Tracert

C:\DOCUME~1\skva>tracert www.yahoo.com

Tracing route to www.yahoo-ht2.akadns.net [209.131.36.158] over a maximum of 30 hops:

1    1 ms     1 ms     1 ms  c-24-6-102-212.hsd1.ca.comcast.net [24.6.102.212] 2    *        *        *     Request timed out. 3   11 ms     *        *     GE-2-1-ur01.santaclara.ca.sfba.comcast.net [68.87.198.105] 4   11 ms    11 ms     *     10g-9-3-ur02.santaclara.ca.sfba.comcast.net [68.87.192.26] 5   14 ms     *       12 ms  10g-9-4-ar01.oakland.ca.sfba.comcast.net [68.87.192.34] 6    *        *        *     Request timed out. 7   13 ms    14 ms    12 ms  12.118.38.5 8   13 ms    14 ms    17 ms  tbr1-p010802.sffca.ip.att.net [12.123.12.66] 9   14 ms    14 ms    11 ms  ggr2-p310.sffca.ip.att.net [12.123.12.18] 10   15 ms    15 ms    14 ms  att-gw.sea.level3.net [192.205.32.206] 11   16 ms    14 ms    14 ms  4.71.112.14 12   15 ms    16 ms    17 ms  g-1-0-0-p171.msr2.sp1.yahoo.com [216.115.107.87] 13   16 ms    16 ms    16 ms  te-8-1.bas-a1.sp1.yahoo.com [209.131.32.17] 14   19 ms    17 ms    17 ms  f1.www.vip.sp1.yahoo.com [209.131.36.158]

Trace complete.

The above output from tracert shows the number of routes it took, name of the routers on the way and time taken to reach each router. It took 14 hops to reach the yahoo server from my pc. The asterisk indicate the failed attempt for next route.

When I executed the command ‘tracert www.yahoo.com’ the following happens in the back ground. The packets were captured using ethereal.

Step 1: The PC sends a DNS request to the DNS server to resolve the ip address of yahoo.com.

192.168.1.101 to 68.87.76.178 DNS standard query A www.yahoo.com 68.87.76.178 to 192.168.1.101 DNS standard query response CNAME www.yahoo-ht2.akadns.net Address 209.131.36.158

Step 2: After getting yahoo.com ip address, tracert sends icmp echo request message with TTL set to 1, Each echo request is received by the router at the first hop , which responds with ‘time to live exceeded live‘ message. Each hop packets are analyzed below.

Hop 1
1    1 ms     1 ms     1 ms  c-24-6-102-212.hsd1.ca.comcast.net [24.6.102.212] Echo request packets were sent with TTL set to 1

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a8 f9 00 00 01 01 58 79 c0 a8 01 65 d1 83  .\......Xy...e.. 0020  24 9e 08 00 f4 ff 02 00 01 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 4f  ...z.b.....V..EO 0010   00 38 0a 93 00 00 40 01 2e fc 18 06 66 d4 c0 a8  .8....@.....f... 0020  01 65 0b 00 f4 ff 00 00 00 00 45 00 00 5c a8 f9  .e........E..\.. 0030  00 00 01 01 58 79 c0 a8 01 65 d1 83 24 9e 08 00  ....Xy...e..$... 0040  f4 ff 02 00 01 00                                ......

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a8 fa 00 00 01 01 58 78 c0 a8 01 65 d1 83  .\......Xx...e.. 0020  24 9e 08 00 f3 ff 02 00 02 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 4f  ...z.b.....V..EO 0010   00 38 0a 94 00 00 40 01 2e fb 18 06 66 d4 c0 a8  .8....@.....f... 0020  01 65 0b 00 f2 ff 00 00 00 00 45 00 00 5c a8 fa  .e........E..\.. 0030  00 00 01 01 58 78 c0 a8 01 65 d1 83 24 9e 08 00  ....Xx...e..$... 0040  f3 ff 02 00 02 00                                ......

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a8 fa 00 00 01 01 58 78 c0 a8 01 65 d1 83  .\......Xx...e.. 0020  24 9e 08 00 f3 ff 02 00 02 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 4f  ...z.b.....V..EO 0010   00 38 0a 94 00 00 40 01 2e fb 18 06 66 d4 c0 a8  .8....@.....f... 0020  01 65 0b 00 f4 ff 00 00 00 00 45 00 00 5c a8 fa  .e........E..\.. 0030  00 00 01 01 58 78 c0 a8 01 65 d1 83 24 9e 08 00  ....Xx...e..$... 0040  f3 ff 02 00 02 00                                ......

Hop 2
2    *        *        *     Request timed out. Echo request packets were sent with TTL set to 2

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 01 00 00 02 01 57 71 c0 a8 01 65 d1 83  .\......Wq...e.. 0020  24 9e 08 00 f1 ff 02 00 04 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 01 00 00 02 01 57 71 c0 a8 01 65 d1 83  .\......Wq...e.. 0020  24 9e 08 00 f1 ff 02 00 04 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 01 00 00 02 01 57 71 c0 a8 01 65 d1 83  .\......Wq...e.. 0020  24 9e 08 00 f1 ff 02 00 04 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

Hop 3
3   11 ms     *        *     GE-2-1-ur01.santaclara.ca.sfba.comcast.net [68.87.198.105] Echo request packets were sent with TTL set to 3

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 41 00 00 03 01 56 31 c0 a8 01 65 d1 83  .\.A....V1...e.. 0020  24 9e 08 00 ee ff 02 00 07 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 c0  ...z.b.....V..E. 0010   00 38 23 76 00 00 fd 01 cc c0 44 57 c6 69 c0 a8  .8#v......DW.i.. 0020  01 65 0b 00 f4 ff 00 00 00 00 45 20 00 5c a9 41  .e........E .\.A 0030   00 00 01 01 58 11 c0 a8 01 65 d1 83 24 9e 08 00  ....X....e..$... 0040  ee ff 02 00 07 00                                ......

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 42 00 00 03 01 56 30 c0 a8 01 65 d1 83  .\.B....V0...e.. 0020  24 9e 08 00 ed ff 02 00 08 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 59 00 00 03 01 56 19 c0 a8 01 65 d1 83  .\.Y....V....e.. 0020  24 9e 08 00 ec ff 02 00 09 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

Hop 4
4   11 ms    11 ms     *     10g-9-3-ur02.santaclara.ca.sfba.comcast.net [68.87.192.26] Echo request packets were sent with TTL set to 4

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 6c 00 00 04 01 55 06 c0 a8 01 65 d1 83  .\.l....U....e.. 0020  24 9e 08 00 eb ff 02 00 0a 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 c0  ...z.b.....V..E. 0010   00 38 6e 22 00 00 fd 01 88 63 44 57 c0 1a c0 a8  .8n".....cDW.... 0020   01 65 0b 00 f4 ff 00 00 00 00 45 20 00 5c a9 6c  .e........E .\.l 0030   00 00 01 01 57 e6 c0 a8 01 65 d1 83 24 9e 08 00  ....W....e..$... 0040   eb ff 02 00 0a 00                                ......

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 6d 00 00 04 01 55 05 c0 a8 01 65 d1 83  .\.m....U....e.. 0020  24 9e 08 00 ea ff 02 00 0b 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 c0  ...z.b.....V..E. 0010   00 38 6e 23 00 00 fd 01 88 62 44 57 c0 1a c0 a8  .8n#.....bDW.... 0020  01 65 0b 00 f4 ff 00 00 00 00 45 20 00 5c a9 6d  .e........E .\.m 0030   00 00 01 01 57 e5 c0 a8 01 65 d1 83 24 9e 08 00  ....W....e..$... 0040  ea ff 02 00 0b 00                                ......

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 6e 00 00 04 01 55 04 c0 a8 01 65 d1 83  .\.n....U....e.. 0020  24 9e 08 00 e9 ff 02 00 0c 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

Hop 5
5   14 ms     *       12 ms  10g-9-4-ar01.oakland.ca.sfba.comcast.net [68.87.192.34] Echo request packets were sent with TTL set to 5

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 89 00 00 05 01 53 e9 c0 a8 01 65 d1 83  .\......S....e.. 0020  24 9e 08 00 e8 ff 02 00 0d 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 c0  ...z.b.....V..E. 0010   00 38 fa 4e 00 00 fc 01 fd 2e 44 57 c0 22 c0 a8  .8.N......DW.".. 0020   01 65 0b 00 f4 ff 00 00 00 00 45 20 00 5c a9 89  .e........E .\.. 0030   00 00 01 01 57 c9 c0 a8 01 65 d1 83 24 9e 08 00  ....W....e..$... 0040   e8 ff 02 00 0d 00                                ......

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 8a 00 00 05 01 53 e8 c0 a8 01 65 d1 83  .\......S....e.. 0020  24 9e 08 00 e7 ff 02 00 0e 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 9f 00 00 05 01 53 d3 c0 a8 01 65 d1 83  .\......S....e.. 0020  24 9e 08 00 e6 ff 02 00 0f 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 c0  ...z.b.....V..E. 0010   00 38 fc 75 00 00 fc 01 fb 07 44 57 c0 22 c0 a8  .8.u......DW.".. 0020   01 65 0b 00 f4 ff 00 00 00 00 45 20 00 5c a9 9f  .e........E .\.. 0030   00 00 01 01 57 b3 c0 a8 01 65 d1 83 24 9e 08 00  ....W....e..$... 0040   e6 ff 02 00 0f 00                                ......

Hop 6
6    *        *        *     Request timed out. Echo request packets were sent with TTL set to 6

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 a5 00 00 06 01 52 cd c0 a8 01 65 d1 83  .\......R....e.. 0020  24 9e 08 00 e5 ff 02 00 10 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 a5 00 00 06 01 52 cd c0 a8 01 65 d1 83  .\......R....e.. 0020  24 9e 08 00 e4 ff 02 00 10 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 a5 00 00 06 01 52 cd c0 a8 01 65 d1 83  .\......R....e.. 0020  24 9e 08 00 e5 ff 02 00 10 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

Hop 7
7   13 ms    14 ms    12 ms  12.118.38.5 Echo request packets were sent with TTL set to 7

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c a9 dc 00 00 07 01 51 96 c0 a8 01 65 d1 83  .\......Q....e.. 0020  24 9e 08 00 e2 ff 02 00 13 00 00 00 00 00 00 00  $............... 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 00  ...z.b.....V..E. 0010   00 38 00 00 00 00 f8 01 ce 3c 0c 76 26 05 c0 a8  .8.......<.v&... 0020  01 65 0b 00 f4 ff 00 00 00 00 45 20 00 5c a9 dc  .e........E .\.. 0030  00 00 01 01 57 76 c0 a8 01 65 d1 83 24 9e 08 00  ....Wv...e..$... 0040  e2 ff 02 00 13 00                                ......

Hop 8 to Hop 13
Echo request packets were sent with TTL set to 8 to 13 respectively

8   13 ms    14 ms    17 ms  tbr1-p010802.sffca.ip.att.net [12.123.12.66] 9   14 ms    14 ms    11 ms  ggr2-p310.sffca.ip.att.net [12.123.12.18] 10   15 ms    15 ms    14 ms  att-gw.sea.level3.net [192.205.32.206] 11   16 ms    14 ms    14 ms  4.71.112.14 12   15 ms    16 ms    17 ms  g-1-0-0-p171.msr2.sp1.yahoo.com [216.115.107.87] 13   16 ms    16 ms    16 ms  te-8-1.bas-a1.sp1.yahoo.com [209.131.32.17]

Hop 14
14   19 ms    17 ms    17 ms  f1.www.vip.sp1.yahoo.com [209.131.36.158] Echo request packets were sent with TTL set to 2

0000  00 13 10 d4 d7 56 00 0e 9b 7a af 62 08 00 45 00  .....V...z.b..E. 0010   00 5c aa 22 00 00 0e 01 4a 50 c0 a8 01 65 d1 83  .\."....JP...e.. 0020   24 9e 08 00 cd ff 02 00 28 00 00 00 00 00 00 00  $.......(....... 0030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

0000  00 0e 9b 7a af 62 00 13 10 d4 d7 56 08 00 45 00  ...z.b.....V..E. 0010   00 5c 92 b2 00 00 33 01 3c c0 d1 83 24 9e c0 a8  .\....3.<...$... 0020  01 65 00 00 d5 ff 02 00 28 00 00 00 00 00 00 00  .e......(....... 0030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 0060   00 00 00 00 00 00 00 00 00 00                    ..........

The above reply indicates the destination, www.yahoo.com. Thus tracert tool can be used to troubleshooting the network and finding the path of the network.

Conclusion
Ethereal is a powerful tool to capture and analyze many networking protocols. It does not detect or solve any network problem by itself but it can always be used to do so. It gives all the relevant details for any communication so it is used in research work and other relevant fields.

Questions and Answers
Q1. What is the value for ICMP protocol message

a.	0x10

b.	10

c.	0x01

d.	1

Ans: a, 0x10

Q2. How does yahoo messenger protocol header start ? a.	YHOO

b.	YMSG

c.	YCHT

d.	No such yahoo messenger protocol

Ans: b, YMSG

Q3. Study the following figure Ethereal capture shown below:

1. What is the selected message(no: 18) all about?

Answer: the sync message is the first message sent from the client to the server as the first message in of the three way handshake protocol in order to establish the connection with the server. The sync message establishes the connection and synchronizes the client and the server. The server then sends the acknowledgement signal.

2. What is the four tuple of this communication? Answer:  Four tuple  of any exercise is source IP, source port no: and destination IP, destination port no:. for this communication the four tuple would be:
 * 192.168.1.76, 1942
 * 203.84.221.151, 80

title: Communication Networks/Ethereal


text:
Communication Networks/Ping

Ping
Ping is a basic Internet tool that allows a user to verify that a particular IP address exists and can accept requests. The verb ping means the act of using the ping utility or command. Ping is used diagnostically to ensure that a host computer you are trying to reach is actually operating. If, for example, a user cannot ping a host, then the user will be unable to use the File Transfer Protocol (FTP) to send files to that host. Ping can also be used with a host that is operating to see how long it takes to get a response back. Using ping, you can learn the number form of the IP address from the symbolic domain name.

Loosely, ping means "to get the attention of" or "to check for the presence of" another party online. Ping operates by sending a packet to a designated address and waiting for a response. The computer acronym (for Packet Internet or Inter-Network Groper) was contrived to match the submariners' term for the sound of a returned sonar pulse.

Ping can also refer to the process of sending a message to all the members of a mailing list requesting an ACK (acknowledgment code). This is done before sending e-mail in order to confirm that all of the addresses are reachable.

The Internet Ping command bounces a small packet off a domain or IP address to test network communications, and then determines how long the packet took to make the round trip. The Ping command is one of the most commonly used utilities on the Internet by both people and automated programs for conducting the most basic network test: can your computer reach another computer on the network, and if so how long does it take?

Every second of the day there are untold millions of pings flashing back and forth between computers on the Internet like a continuous shower of electronic neural sparks. The following subsections provide information on how Ping was invented, how Ping works, how to use Ping, Ping web sites, and info on the original Unix Ping version.

How Ping was invented
The original PING command stood for "Packet Internet Groper", and was a package of diagnostic utilities used by DARPA personnel to test the performance of the ARPANET. However, the modern Internet Ping command refers to a program was written by Mike Muuss in December, 1983, which has since become one of the most versatile and widely used diagnostic tools on the Internet. Muuss named his program after the sonar sounds used for echo-location by submarines and bats; just like in old movies about submarines, sonar probes do sound something like a metallic "ping".

How Ping works
The Internet Ping program works much like a sonar echo-location, sending a small packet of information containing an ICMP ECHO_REQUEST to a specified computer, which then sends an ECHO_REPLY packet in return. The IP address 127.0.0.1 is set by convention to always indicate your own computer. Therefore, a ping to that address will always ping yourself and the delay should be very short. This provides the most basic test of your local communications.

How to use Ping
You can use the Ping command to perform several useful Internet network diagnostic tests, such as the following:

Access : You can use Ping to see if you can reach another computer. If you cannot ping a site at all, but you can ping other sites, then it is a pretty good sign that your Internet network is working and that site is down. On the other hand, if you cannot ping any site, then likely your entire network connection is down due to a bad connection. Time & distance : You can use the Ping command to determine how long it takes to bounce a packet off of another site, which tells you its Internet distance in network terms. For example, a web site hosted on your neighbor's computer next door with a different Internet service provider might go through more routers and be farther away in network distance than a site on the other side of the ocean with a direct connection to the Internet backbone.

If a site seems slow, you can compare ping distances to other Internet sites to determine whether it is the site, the network, or your system that is slow. You can also compare ping times to get an idea of which sites have the fastest network access and would be most efficient for downloading, chat, and other applications. Domain IP address : You can use the Ping command to probe either a domain name or an IP address. If you ping a domain name, it helpfully displays the corresponding IP address in the response.

You can run the ping command on a Windows computer by opening a command prompt window and then typing "ping" followed by the domain name or IP address of the computer you wish to ping. You can list the available options for the Windows ping command with "ping -?".

Online ping : If you can't use the Ping command from your own computer because of a firewall or other restriction, or want to do an Internet ping from another location than your own, you can use one of the following web sites that offer online ping services:
 * DNSStuff.com
 * his.com Ping
 * Network-Tools
 * Spfld.com Ping
 * Theworldsend.net ping

Remember when doing an online ping that the packets are sent from that web site, so the times that are returned reflect the path from that location and not from your computer. Nevertheless, a ping from an online web site can be useful to test if an address can be reached from different places around the Internet, to do comparative timing to test how long it takes to reach one site compared to others.

If the times returned by several online ping sites to an Internet address are consistently long, then the destination site's network is likely having problems. On the other hand, if you can ping an address from an online ping site but not from your own computer, then there is likely some block in your network preventing you from communicating with that site.

Unix version : Muuss originally developed the ping command for the Unix system, with the options summarized below:

ping [-q] [-v] [-R] [-c Count] [-i Wait] [-s PacketSize] Host

Network Connectivity Check
Two of the most practical connectivity test commands are ping and traceroute. These two commands are good mechanisms for network troubleshooting, and both of these use ICMP.

There are four easy steps defined for troubleshooting IP addressing:

 * 1) Ping 127.0.0.1
 * 2) Ping localhost IP address
 * 3) Ping default gateway
 * 4) Ping the remote server

Each of these could give information about the network status. Step 1 is generally a loopback test, which means the IP stack is initialized if successful. Then if Step 2 is successful, it means that the Network Interface Card (NIC) is functioning properly. Step 3 allows the user to find that the machine can communicate within the local network. Lastly, Step 4 gives the administrator the information of a host that successfully communicates with the remote server, where the remote physical server is working.

Ping
Ping is a computer program that determines if a host is up or not. Ping basically consists of a source sending an ICMP "echo request" to a target, followed by the target replying with an ICMP "echo response" - assuming the target is up. A typical output of Ping is shown in figure 1 and an Ethereal capture in figure 2:

Figure 1: Output of Ping command

Figure 2: ping Ethereal capture

Notice the ICMP echo request and reply comes up in the capture when a Ping command is performed. The Type and Code fields represent the different kinds of action and error results. A brief description of each is shown in the following table:

Traceroute
Traceroute is a computer program that sends ICMP packets to show the route a packet takes across an IP network from source to destination. It does this by incrementing the time-to-live (TTL) field by 1 for every successive host until it reaches its destination. A traceroute output and Ethereal capture are shown in figures 1 & 2, respectively.

Figure 3: Output of Traceroute command

Figure 4: traceroute Ethereal capture

Notice a TTL timeout message sent back to the source every time an ICMP message passes a network device. Then the source will record the router name.

title: Communication Networks/Ping


text:
Communication Networks/HTTP Protocol

Hypertext Transfer Protocol (HTTP)
The Hypertext Transfer Protocol (HTTP) is an application layer protocol that is used to transmit virtually all files and other data on the World Wide Web, whether they're HTML files, image files, query results, or anything else. Usually, HTTP takes place through TCP/IP sockets.

A browser is an HTTP client because it sends requests to an HTTP server (Web server), which then sends responses back to the client. The standard (and default) port for HTTP servers to listen on is 80, though they can use any port.

HTTP is based on the TCP/IP protocols, and is used commonly on the Internet for transmitting web-pages from servers to browsers.

Network Application: Client Server Paradigm

The client and server are the end systems also known as Hosts. The Client initiates contact with the server to request for a service. Such as for Web, the client is implemented in the web browser and for e-mail, it is mail reader. And in similar fashion, the Server provides the requested service to client by providing with the web page requested and mail server delivers e-mail.

Peer to Peer Paradigm

In the network, a peer can come anytime and leave the network anytime. So a peer can be a Client or Server. So the Scalability is the advantage in this peer to peer network. Along with Client Server and Peer to Peer Paradigm, it also supports hybrid Peer to Peer and Client Server in real world.

The HTTP protocol also supports one or more application protocols which we use in our day to day life. For e-mails, we use the SMTP protocol, or when we talk to other person on telephone via the web world (Voip). So these applications are through the web world. They define the type of message and the syntax used. Also it gives information on the results or actions taken.

Identifying Applications

When the process of communication has to be performed, there are two main things which are important to know, they are: 1. IP Address: This IP address is of the host running the process. It is an 32 bit address which is unique ID. From this IP address, the host is recognized and used to communicate to the web world. 2. Port Number: The combination of IP address and Port number is called as Socket. Hence, Socket = ( IP address, Port number)

So whenever the client or web user application communicates with the web server, it needs four important components also called as TCP Connection tuple. This tuple consists of: 1. Client IP address 2. Client Port number 3. Source IP address 4. Source Port number

HTTP protocol uses TCP protocol to create an established, reliable connection between the client (e.g. the web browser) and the server (e.g. wikibooks.org). All HTTP commands are in plain text, and almost all HTTP requests are sent using TCP port 80, of course any port can be used. HTTP protocol asks that each request be in IP address form, not DNS format. So if we want to load www.wikibooks.org, we need to first resolve the wikibooks.org IP address from a DNS server, and then send out that request. Let's say (and this is impossible) that the IP address for wikibooks.org is 192.168.1.1. Then, to load this very page, we would create a TCP packet with the following text:

GET 192.168.1.1/wiki/Communication_Systems/HTTP_Protocol HTTP/1.1

The first part of the request, the word "GET", is our HTTP command. The middle part of the request is the URL (Universal Resource Locator) of the page we want to load, and the last part of the request ("HTTP/1.1") tells the server which version of HTTP the request is going to use.

When the server gets the request, it will reply with a status code, that is defined in the HTTP standard. For instance: HTTP/1.1 200 OK

or the infamous

HTTP/1.1 404 Not Found

The first part of the reply is the version of HTTP being used, the second part of the reply is the error code number, and the last part of the reply is the message in plain, human-readable text.

The Web
The web world consists of numerous web pages which consists of objects which are addressed by URL. The web pages mostly consist of HTML pages with a few referenced objects. The URL known as Uniform Resource Locator consists of host name and path name.

The host name is www.sjsu.edu/student/tower.gif

The Web User sends request to the Web Server through agent such as Internet Explorer or Firefox. This User agent handles all the HTTP request to Web server. The same applies to Web Server when it send information to Web User through servers known as Apache server or MS Internet Information Server.

The HTTP is the Web’s application layer protocol works on the Client-Server technology. The client request for the HTML pages towards server and the server responses with HTML pages. In this, the client requests pages and objects through its agent and Server responses them with the requested objects by displaying.

How this works??

The HTTP:TCP transport service uses sockets to transfer the data. The client initiates the TCP connection by using sockets on port 80 to the server. Then the server accepts the connection from the client. The client requests with the HTML pages and the objects which are then exchanged between the client browser and web server. After completing the request, the TCP connection is closed.

As HTTP is a stateless protocol. It does not keep user information about the previous client requests. So, this protocol is simple but if you have to maintain the past client records then it is complex. Since the server will maintain all the client requests and when the server crashes, it is very difficult to get the information back and makes the system very complex.

HTTP Connections
The web page consists of objects and URL’s. As there can be one or many objects or URL’s, the type of HTTP connection determines the order in which the objects are requested.

Since the HTTP is constantly evolving to improve its performance, there are two types of connections: • Non-Persistent (HTTP/1.0) • Persistent (HTTP/1.1)

The major difference between non-persistent and persistent connection is the number of TCP connection(s) required for transmitting the objects.

Non-Persistent HTTP – This connection requires that each object be delivered by an individually established TCP connection. Usually there is one round trip time delay for the initial TCP connection. Suppose user requests the page that contains text as well as 5 images. The number of TCP connections will be as follows:

Persistent HTTP - This connection is also called as HTTP keep-alive, or HTTP Reuse. The idea is to use the same TCP connection to send and receive multiple HTTP requests/responses using the same connection. Using persistent connection is important to improve performance.

Persistent HTTP without Pipelining – In this connection, each client has to wait for the previously requested object received before issuing a new request for another object. Thus, not counting the initial TCP establishment (one RTT time), each object needs at least one RTT plus the transmission time of the object by the server.

Persistent HTTP with Pipelining – Can allow client to send out all (multiple) requests, so servers can receive all requests at once, and then sending responses (objects) one after another. The Pipelining method in HTTP/1.1 is default. The shortest time in pipelining is one initial RTT, RTT for request and response and the transmission time of all the objects by the server.

Thus, we can say that the number of RTT’s required in all the above types considering for some text and three objects would be:

 * 1) Non-persistent HTTP:
 * 2) Persistent HTTP
 * 3) Without Pipelining:
 * 4) With Pipelining:

Response Time (Modeling)
Round Trip Time (RTT): The time taken to send a packet to remote host and receive a response: used to measure delay on the network at a given time.

Response time:

The response time denotes the time required to initiate the TCP connection and the next response and requests to receive back along with the file transmission time.

The following example denotes the response time -

From the above fig. we can state that the response time is :

2 RTT + File transmit time.

HTTP Message Format :
There are two types of messages that HTTP uses – 1. Request message 2. Response message

1. Request Message:
The request line has three parts, separated by spaces: a method name, the local path of the requested resource and version of HTTP being used. The message format is in ASCII so that it can be read by the humans.

For e.g.:

GET /path/to/the/file.html HTTP/1.0

The GET method is the most commonly used. It states that “give me this resource”. The part of the URL is also called as Request URL. The HTTP is to be in uppercase and the next part denotes the version of HTTP.

HTTP Request Message: General Format

The HTTP Request message format is shown below:

The method is the type of method used to request the URL. Like GET, POST or HEAD. The URL block contains the requested URL. Version denotes the HTTP version. Either HTTP/1.0 or HTTP/1.1. The header lines include the browser type, host, number of objects and file name and the type of language in the requested page. For e.g.:

The entity body is used by the POST method. When user enters information on to the page, the entity body contains that information.

The HTTP 1.0 has GET, POST and HEAD methods. While the HTTP 1.1 has along with GET, POST and HEAD, PUT and DELETE.

Uploading the information in Web pages

The POST method

The Web pages which ask for input from user uses the POST method. The information filled by the web user is uploaded in server’s entity body.

The typical form submission in POST method. The content type is usually the application/x-www-form-urlencoded and the content-length is the length of the URL encoded form data.

The URL method

The URL method uses the GET method to get user input from the user. It appends the user information to be uploaded to server to the URL field.

2. Response Message:
The HTTP message response line also has three parts separated by spaces: the HTTP version, a response status code giving result of the request and English phrase of the status code. This first line is also called as Status line.

The HTTP Response message format is shown below:

E.g.:

Below are the some HTTP response status codes:

200 OK The request succeeded, and the resulting resource (e.g. file or script output) is returned in the message body.

404 Not Found The requested resource doesn't exist.

301 Moved Permanently

302 Moved Temporarily

303 See Other (HTTP 1.1 only)

The resource has moved to another URL (given by the Location: response header), and should be automatically retrieved by the client. This is often used by a CGI script to redirect the browser to an existing file.

500 Server Error

An unexpected server error. The most common cause is a server-side script that has bad syntax, fails, or otherwise can't run correctly.

User Server Identification
The HTTP Protocol is a stateless protocol. So there should be an mechanism to identify the user using the web server. There are various techniques used:

1. Authentication 2. Cookies

1. Authentication:

The Client whenever request for the web page from the web server, the server authenticates the user. So each time whenever the web user or client requests any object, it has to provide a name and password to be identified by server. The need arises for the authentication so that the server has control over the documents. And, Since the HTTP protocol is stateless, it has to provide information each time it requests for web page. The authorization is done at the header line of the request. Generally, the cache is used to store the name and password of the web user. So that, each time it doesn’t have to provide the same information.

2. Cookies

Cookies are used by web servers to identify the web user. They are small piece of data stored into the web users disk. It is used in all major websites. As they have relatively much more importance in the web world. As said earlier, cookie is a small piece of data and not a code. This piece of small information is stored into web users machine whenever the browser visits the server site’s.

So how do the Cookie function exactly?

When the web users browser requests a file from web server, it send the file along with a cookie. So the next time whenever the web browser requests the same server a file, it sends the previous cookie to the web server so that it identifies that the browser had previously requested for a file. And so the web server coordinates your access to different pages from its website.

A typical example can be when you do online shopping., where cookie is used to traced your shopping basket.

The major four component of Cookie are:

1. Cookie header line in the HTTP response message. 2. Cookie header line in the HTTP request message. 3. Cookie file stored in User’s host and managed by User’s browser. 4. Back end database at the web site. So we can say that Cookies are used to keep the State of the web browser. Since HTTP is a stateless, so there should be some means for server to remember the state of the client’s request.

Cookies are in two flavors, one is persistent and the other is non-persistent. Persistent Cookies remain in the web browser’s machine memory for the specified time when it was first created. While non-persistent cookies are the ones which are deleted as soon as the web user’s browser is closed.

Cookies bring a number of useful applications in today’s Internet world. With the help of cookie, you can have: • User accounts • Online Shopping • Web Portals • Advertising

But with these cookies, you can secretly track down the web user’s habits. As whenever a web browser sends a request to web server, it includes its IP address, the type of browser you use and your operating system. So this information is also logged into the server’s file.

The Advertising is the main issue in cookies. Since, it is less admirable because of its use as a tracking of individual’s browsing and buying habits. As the server’s log file has all your information, so it becomes easier to track you. The advertisement firm has many clients which includes another several advertising firms. So it has contracts with many other agencies. They place an image file on their web site. Once you click on them, you are not clicking on the image but a link to another advertising firm’s site. So it sends a cookie to you when you request for that page. And thus, your IP address is tracked down. Whenever you request to their site’s page, they can track your number of visits to their site, which page you have visited and how often. Therefore, they come to know about your interests. So this important piece of information is valuable to them to track your preferences and target you based on your inferences.

Web Caching (Proxy Server)
The proxy server’s main goal is to satisfy client’s request without involving the original web server. It is a server acting like as a buffer between the Client’s web browser and the Web server. It accepts the requests from the user and responses to them if it contains the requested page. If it doesn’t have the requested page, then it requests to Original Web Server and responses to the client. It uses cache to store the pages. If the requested web page is in cache, it fulfills the request speedily.

Working of Proxy Server

The two main purpose of proxy server are:

1. Improve Performance –

As it saves the result for a particular period of time. If the same result is requested again and if it is present in the cache of proxy server then the request can be fulfilled in less time. So it drastically improves the performance. The major online searches do have an array of proxy servers to serve for a large number of web users.

2. Filter Requests -

Proxy server’s can also be used to filter requests. Suppose an company wants to restrict the user from accessing a specific set of sites, it can be done with the help of proxy servers.

Conditional GET

The conditional GET is the same as GET method. It only differs by including the If-modified-since, If-unmodified-since, If-match, If-None-Match or If-Range header field. The conditional GET method requests can be satisfied under the given conditions. This is method is used to reduce the network usage so that cache entities can be utilized to fulfill requests if they are not modified and avoids unnecessary transferring of data.

Working of Conditional GET: Whenever the client request to the server for html page, the proxy server checks the requested page in its cache. It checks the last-modified date entry in the header If the requested page in the cache entry determined to be out of date, the proxy server requests the updated page from the main server. And then, the main server responds to that requests and sends updates to the page to the proxy server; which are then forwarded to the client, as well as stored in the proxy server cache.

HTTPS
The HTTPS is a secure version of HTTP. It indicates the port 443 should be used instead of port 80. It is widely used, both in security concern areas such as eCommerce, as well as crime prevention by attempting to make sure the end user is actually getting the sites he was looking for. The protocol identifier HTTPS instructs the user agent the user is looking for a secure channel.

The HTTPS follows a procedure to follow secure connection in the network. The secure connection is done automatically. The steps are:
 * 1) The client authenticates the server using the server’s digital certificate.
 * 2) The client and server negotiate with the cipher suite (a set of security protocols) they will use for the connection.
 * 3) The client and server generate session keys for encrypting and decrypting data.
 * 4) The Client and server establish a secure encrypted connection.

The HTTPS ends its session whenever the client or server cannot negotiate with the cipher suite. The cipher suite can be based on any of the following:
 * 1) Digest Based –
 * 2) * Message Digest 5 (MD5)
 * 3) * Secure Hash Algorithm 1 (SHA-1)
 * 4) Public Key-Based –
 * 5) * Rivest-Shamir-Adelman (RSA) encryption/decryption.
 * 6) * Digital Signature Algorithm (DSA)
 * 7) * Diffie-Hellman Key-exchange/Key-generation.
 * 8) X.509 digital certificates.

SUMMARY
This chapter includes HTTP how the Web World is all about. The various methods used in TCP connection to transfer the data in the web world. It has detail information on requests and response methods. Also it contains the User Identification methods like Authentication and Cookies. The cookies part is explained in detail. Also the various connections in HTTP, like non-persistent and persistent connections. We have also mentioned about the proxy server and how does it works. And lastly, the secure version of HTTP.i.e. HTTPS.

title: Communication Networks/HTTP Protocol


text:
Communication Networks/DNS

Domain Name System (DNS)
A domain name identifies the area or domain that an Internet resource resides in.

The application layer consists of various applications. Out of those one is DNS, which stands for Domain Name System. The very first question arise: ‘what is the need of this application?’. To begin with let’s start with a real world example. There are many identifiers to be a unique person in the world, such as SSN, name, and Passport number along with the county who issued it, etc. In the similar fashion, every computer or host and router in the world has a unique identifying 32-bit ‘IP’ address. Say if we need some information that is on other part of the world. We need to know the IP address of that machine. Remembering IP addresses is difficult, as it contains all numbers. To remember IP addresses of more than one host becomes cumbersome. Therefore a name has been assigned to almost every IP address which makes it easier for humans to remember. DNS provides mapping of IP address and Domain name. (More details of IP address will be covered in further sections.)

How often is this mapping needed?

Answer. Every time when a host needs to convert a domain name to the IP address, a DNS query is called.

DNS Service
1. Host name to IP address translation

The primary purpose of DNS is to provide translation of host name to IP address and vice versa. The backward facility (translating IP address to domain name) is known as Reverse DNS.

2. Host aliasing

Host aliasing is referred to another name given to the same machine on the network. It is used because a hostname may have a complicated name instead of that a simple term may be used. E.g. relay.eastcost.rediff.com may have an alias name rediff.com

3. Mail server aliasing

It is highly desirable that an email address should contain simple letters, or should be something that can be easy to remember. E.g. richard@gmail.com can be remembered easily but if the original mail server address, say la4.mail1.google.com, were to be used it would be difficult to remember

4. Load distribution

A set of IP address is provided to one canonical name which prevents the load to be present only on one server. “When the request comes to the DNS server to resolve the domain name, it gives out one of the several canonical names in a rotated order. This redirects the request to one of the several servers in a server group. Once the BIND feature of DNS resolves the domain to one of the servers, subsequent requests from the same client are sent to the same server.”

Why not centralize DNS?
Problems that arise when we try to centralize DNS.

 * 1) Single point of failure
 * 2) Increase in traffic volume
 * 3) Distant centralized database
 * 4) Maintenance

As centralized DNS does not scale because of the reasons mentioned above, a need arose to implement DNS in a distributed manner. The DNS is a distributed system, implemented in a hierarchy of many name servers. The decentralized administration is achieved through delegation.

Structure of DNS

Fig. Structure of Domain Name System (DNS)

The structure of DNS is similar to the structure of Unix file system. It is a tree-like structure in which the root is known as the Root DNS sever. Each node in the tree is associated with a resource record which holds the information associated with it, and can have any number of branches. There can be a maximum of 127 levels in a tree; however, you will never find any domain name that long. Each node in a tree represents its part in a domain name which can contain a maximum of 63 characters long.

The full domain name of any node in the tree is the sequence of each node in that path from the node to the root. Domain name is read from the node to the root with a dot placed separating the names in the path. No two nodes can have the same name if and only if they have the same parent. This guarantees that each domain name in the DNS tree corresponds to unique domain name in the entire DNS structure. E.g. you can not have multiple directories named “Program Files” in one single directory, but if you wish you can have a directory name “Program Files” in your root directory of your C drive, and in the “C:\Windows” directory (or in any number of distinct directory locations).

“A domain is simply a subtree of the domain name space. The domain name of a domain is the same as the domain name of the node at the very top of the domain.” Consider the figure below

Fig. sjsu.edu domain

As you can see in the figure above that the “sjsu” domain is a part of the edu domain. In the similar fashion there can be many domains in the “sjsu” domain. “Any domain name in the subtree is consider a part of the domain. Because a domain name can be in many subtrees, it can be in many domains.”

Fig. Subdomain (domain under domain)

After going through all these details, the very first question arises: if there are domains inside a domain, then where are all the hosts? If you would remember we had discussed earlier that the domain names are indexed into DNS. A domain may have a single host or a collection of host. Hosts are connected logically and may be dispersed to geographical locations. You may have 100 hosts connected to same domain that are located in different countries, or maybe all those host would be in different network too. Usually, the leaves in the tree represents hosts and may point to single network address, hardware information, and mail routing information. The interior nodes of the tree that represent a domain can also be used to represent a host on the network. E.g. In the above fig.sjsu.edu can be both ‘San Jose State University domain’ and also the name of the host (more specifically a web server) that run that domain.

A domain may contain many subdomains inside it. To identify if domain is a subdomain of another domain, you need to compare the domain name with its parent domain name. E.g. se.sjsu.edu is a subdomain of the sjsu.edu domain. The other way to determine the subdomains is through looking at the levels of the tree.

Clients wants IP of sjsu.edu
1. First of all, Client queries a root server to find the IP address of edu (TLD - top-level domain) DNS server. then,

2. Client queries edu (TLD) DNS server to get sjsu.edu (authoritative server) DNS server. and then,

3. Client queries sjsu.edu DNS server to get the IP address for www.sjsu.edu (Hostname).

Root DNS Servers
The root DNS servers (root name servers) keep track of all the authoritative name servers of each of the Top Level Domain (TLD) name servers. The client queries the root name servers to resolve a request for the given domain name. In response the root name server provides the address of the TLD name server for the given query in which the domain name ends with. E.g. If a client requests for google.com, the root name server will address the client to the com DNS server so as to solve his query. The top level name server holds the list of authoritative name server in their respective domain. E.g. The com domain holds the address of yahoo.com, google.com etc. The querier (the term querier is given because there are two approach for resolving a request – iterative and recursive approach) then queries the top level name server to resolve the query which returns the address of the authoritative name server. Each name server query gives the querier the required information or takes him one step ahead towards its destination. Root name servers play a key role in resolving any DNS query. Usually DNS provides caching which reduces the load at the root name server. In event when the local name server is unable to find the given domain in its cache the query arrives at the root name server.

Fig. 13 root name servers worldwide

There are 13 root name servers worldwide. If a situation arises that the entire 13 root name servers are unreachable, the Internet would fail. Usually a host sends a query to its nearest root name server. If any one of these servers fails the requests are diverted to another nearest server. E.g. If you are in India the nearest root name server is at Tokyo. If the root name server at Tokyo is down, all the DNS queries or traffic is diverted to server at Europe, which is the next nearest server to India.

Top Level Domain (TLD)
As discussed earlier, each domain name is made up of a series of character strings (called "labels") separated by dots. The right-most label in a domain name is referred to "Top-Level Domain" (TLD). Every TLD includes many second-level domains E.g. sjsu.edu. Every second level TLD may include number of third level domains. E.g. se.sjsu.edu. This process can go on.

Refer to the fig. structure of domain to find out where exactly are TLD located in the DNS hierarchy. The TLD divides the internet domain name space into several domains. Most commonly used domains are:

1. com – Usually used by commercial organization. E.g. Yahoo (yahoo.com)

2. edu – Usually used by educational institutes. E.g. San Jose State University (sjsu.edu)

3. org – Used by non profit organizations. E.g. IEEE (ieee.org)

4. mil – used by military organizations. E.g. US army (army.mil)

5. net – In earlier days it was used to represent the network infrastructure. Nowadays it is open public for any commercial organization.

6. gov – used to represents government organization. E.g. NASA (nasa.gov)

Apart from those mentioned above there are many more domains available. Every country has its own domain name space, which is represented by the name of the country. E.g. United States has a domain name ‘us’, India has a domain name ‘in’.

Zones
Before jumping to the authoritative name servers, we will have a quick overview of zones and delegates. A zone is similar to a domain except a subtle difference. The Top Level Domain and the domains under a Top Level Domain are divided into smaller units with the help of delegation. The need arises to divide these domains into small units, so that it can be managed easily. These small units are called zones. E.g. There would be many zones which are present under the root name servers. They might be com zone, edu zone, org zone etc. similar to a sub-domain concept; here too we have zones present inside zones. Therefore we would have many zones insides the com zone, edu zone, org zone etc. E.g. The edu zone may hold a zone name sjsu.edu, mit.edu etc. In the similar fashion, the com zone may hold yahoo.com zone, cisco.com zone, etc. By dividing the DNS structure into zones, it is each zones responsibility to manage their own domain. E.g. If the edu domain was not divided into different zones, it would be the responsibility of edu to manage sjsu.edu, mit.edu etc. which would become cumbersome for the people who manage the edu domain, therefore it is a natural to break up into different zones depending upon their responsibility.

Authoritative DNS Servers
Refer to fig.1 structure of DNS to check out where exactly are authoritative name servers are located in the DNS hierarchy. All the organizations such as yahoo, msn, sjsu, ieee, etc. contain their own authoritative servers. The goal of authoritative name servers is to provide the mapping of hostname to IP address. All the details for that organization such as web pages, mail routing information etc. are also mentioned in the authoritative name server. Each authoritative name server has to be maintained by their independent organization or by the service provider for that organization.

Each domain or subdomain has one or more authoritative DNS servers that publish information about that domain and the name servers of any domains "beneath" it. Each zone is served by at least one authoritative name server, which contains the complete data for the zone. To make the DNS tolerant of server and network failures, most zones have two or more authoritative servers. Responses from authoritative servers have the "authoritative answer" (AA) bit set in the response packets. We will discuss about the authoritative answer in detail when we will come to the Resource Record section. This makes them easy to identify when debugging DNS configurations using tools like ‘dig’

Local DNS Server
Apart from the Root DNS Server, Top Level DNS server, and the Authoritative DNS server we have a Local DNS Sever. The local name server does not belong strictly to the hierarchy, and that’s the reason you won’t find the local name server in the fig. Structure of Domain Name System. However it still plays an important role indirectly while resolving a DNS query.

Every ISP has a Local DNS server which is some times referred to as default name server. When the host is connected to the ISP, the ISP issues a single IP address through DHCP mechanism (More details of DHCP is covered in section 5.1). You can check your IP address of your computer with the ‘ipconfig’ command in Windows or 'ipconfig' command in Linux.

A host makes a DNS request and when it arrives to the Local DNS server it first checks in cache (more details on DNS caching is covered in further) to see if it can solves the DNS request. If it finds the requested information in the cache, it returns the response to the host. The response it return is called Not Authoritative answer. If the requested information is not found in the cache, then there are two approaches to resolve the given query.

1. Iterative

2. Recursive

In short we can say that the Local DNS server is a proxy to forward the query into the DNS hierarchy. The entire process of resolving the query through the hierarchy remains transparent to the user.

Iterated Queries
Let's have a look at how an iterative approach works. We assume that a hostname se.sjsu.edu is requesting the IP address of mail.yahoo.com. We also assume that the authoritative DNS server for mail.yahoo.com is dns.yahoo.com. The way the DNS resolves the request is shown below.

Fig. Host ‘se.sjsu.edu’ is requesting for IP address of mail.yahoo.com – Iterative Query

The host se.sjsu.edu sends a DNS query to the local DNS server to translate the hostname ‘mail.yahoo.com’, provided in the query, to the IP address. In response, the local DNS server i.e. dns.sjsu.edu forwards the query to the root DNS server. The root DNS server finds the suffix as ‘com’ and returns a list of IP address of the top-level DNS server responsible for ‘com’. The local DNS server then sends the same query to one of the top level DNS servers which were provided by the root DNS server. The top-level DNS server finds a suffix yahoo.com and returns the local DNS server with an IP address of the authoritative DNS server for Yahoo i.e. yahoo.com. Finally, the local DNS server sends the same query again to the authoritative DNS server dns.yahoo.com, which in turn responds with the IP address of mail.yahoo.com.

The above process can be summarized as

User's computer: "What is the IP Address of mail.yahoo.com?" Local name server: "I don't know that. But I'll check with a name server that does."

Local name server: "What is the IP Address of mail.yahoo.com?" Root name server: "Here are the addresses for the TLD name servers for .com."

Local name server: "What is the IP Address of mail.yahoo.com?" TLD .com name server: "Here are the addresses of the authoritative name servers for yahoo.com."

Local name server: "What is the IP address of mail.yahoo.com?" Authoritative mail.yahoo.com name server: "Here is the IP address for mail.yahoo.com, it's 205.139.94.60."

Although it is mentioned that an above method is an iterative approach but actually it makes use of iterative as well as recursive. The query given by se.sjsu.edu to dns.sjsu.edu is a recursive query, but the one which was from the local DNS server to the root DNS server, top-level DNS server and the authoritative DNS server are iterative since all the results are returned back to the local DNS server (dns.sjsu.edu).

Recursive Queries
Just now we had a look on how the iterative query works for solving any DNS query. Let’s now have a look on how recursive approach.

Fig. Host ‘se.sjsu.edu’ is requesting for IP address of mail.yahoo.com – Recursive Query

The complete flow of the recursive query is given below

1.	Requesting host ‘se.sjsu.edu’ request its local DNS server ‘dns.sjsu.edu’ to solve a DNS query ‘mail.yahoo.com’ and to give its IP address

2.	The Local DNS query asks the root DNS server for the IP address of ‘mail.yahoo.com’

3.	The root DNS server finds the ‘com’ suffix in the query and request one of the top level DNS server responsible for com

4.	The com, top level DNS server keeps track of the entire authoritative DNS server; it asks the authoritative DNS server of Yahoo (dns.yahoo.com) for the IP address of mail.yahoo.com

5.	The authoritative DNS server of Yahoo returns the IP address to the com Top Level DNS server who queries the authoritative DNS

6.	The Top level DNS server returns this IP address to root DNS server

7.	The root DNS server in turn returns the IP address to the local DNS query.

8.	The host receives the IP address of its desired query.

In theory, a recursive query is resolved in the manner explained above. But in practice, recursive query is not used as it is not much efficient, and soon it will overrun its stack.

DNS Caching
In the above two approaches (iterative and recursive query) of solving the query we saw that a total of 10 messages had been sent. This reduces the efficiency of DNS. Therefore a caching mechanism is designed so as to reduce the flooding of DNS packets in the cyberspace. The DNS extensively make use of cache so as to improve the performance which is otherwise decrease by going through the root DNS server, TLD server and the authoritative DNS server. Caching reduces traffic of DNS packets over the internet.

When a DNS query is resolved and the IP address of that domain is obtained, the DNS server simply caches the required information from the reply. In the above example (refer to fig 5) each time when the local DNS server dns.sjsu.edu receives a DNS reply from any DNS server, it can cache any of the required information in its cache for future use. Say if the hostname corresponding to the IP address is cached in the local DNS server, the local DNS server can provide the IP address for that hostname in case a query for that hostname arrives in future, although it is not authoritative for that hostname. A local DNS server can store or cache an IP address of the TLD server so as to skip the time asking the root DNS server asking for the IP address of the TLD server.

As mapping of hostname to IP address may change, therefore the DNS server discards its cache after a certain amount of time.

An example of what happens when a query is made to the local DNS server and the mapping is found in its cache.

User's computer: "What is the IP address of mail.yahoo.com" Local DNS server: "I know that. The IP address is 209.73.168.74.

Note: The iterative or recursive query was already executed once before we get such a quick response.

DNS dynamic update / notify
The update/notify mechanism is design under RFC 2136. Many companies and usually all ISP use DHCP (DHCP is covered in section 5.1 in more detail) to assign IP address to the hosts which are connected to them (server). For this DNS is needed to support dynamic addition and deletion of resource records (RR - Resource Records are covered in further sections). This mechanism is called DNS dynamic update.

The dynamic update facility allows authorized updaters to add or delete a RR from a zone where a name server is authoritative. With the help of NS record the authorized update message is sent to the primary node of that zone. If a name server receives any update message and if that name server is not a primary node of that zone then that message is forwarded upstream to its master server. If the server who receives it is also slave then it is again forwarded upstream. This process is called “update forwarding” and it continues till the update message is received to the primary node of that zone.

The primary master name server holds a writable copy of zone data. The slave nodes are notified when an update is performed either directly or indirectly.

DNS Resource Records
Every domain, whether it is a Top Level Domain, or an Authoritative server, or simply a single host have a set of resource records associated with it in the DNS distributed database. These RR provide the mapping of hostname to IP address. The RR is stored in binary format for internal use, but when a RR is transmitted in cyberspace it is text format.

When a query is made to the DNS server, the querier (host/server who sends that query) receives a response which is nothing but the resource record associated with it.

The Resource Records is a 5 tuple that contains the following

( Name, Time to live, Class, Type, Value)

1. Name: It is the domain name to which this resource record belongs to. More than one resource records may exists for the same domain.

2. Time to live: This is a 32 bit integer. The TTL is measured in seconds. The value zero indicates the data should not be cached.

3. Class: The field usually contains the value ‘IN’ it represents if this record is to be used by internet.

4. Type: The type field defines the type of resource record – Address, Name Service, Mail Exchange, Canonical Name.

5. Value: This field can be a number, ASCII strings or any domain. The semantics of Name and Value depends on the type field.

Various type fields along with the details are mentioned below.

1. Type = ‘A’ ‘A’ stands for address where Name = Hostname (e.g. yahoo.com) Value = IP address (e.g. 216.109.112.135) Thus it can provide mapping of hostname to IP address.

2. Type = ‘NS’ ‘NS’ stands for Name Service Name = Domain name (e.g. yahoo.com) Value = Host name of Authoritative DNS server (e.g. dns.yahoo.com)

3. Type = ‘CNAME’ ‘CNAME’ refers to canonical name. It is used to define alias hostname Name = Alias name (e.g. www.ibm.com) Value = Real name of that host (e.g. servereast.backup2.ibm.com)

4. Type = ‘MX’ 'MX’ stands for Mail Exchange. Name = Domain name (e.g. yahoo.com) Value = Name of mail server associated with that name. (e.g. mx.mail.yahoo.com)

DNS messages
As we have finished with most of the parts of DNS, now lets look at how a DNS message looks like. The figure below provides a DNS message format. The query and response, both, are within the same message format.

Fig. DNS message

1. Identification – This is a 16 bit number through which a query is identified. This number is set by client and when a response is send back to the client, the same identification number is used.

2. The Flag consists of 16-bit parameter:

a) The first (0th)bit indicates query(0) or response(1)     b)	Next three bits (1-4) indicates ‘Standard Query (0)’, ‘Inverse Query (1)’ and ‘Server Status Request (2)’. c)	The 5th bit field indicates Authoritative answer. The name server is authoritative for the domain in the question section.     d)	The 6th bit field is set if message was truncated. With UDP this means that the total size of the reply exceeded 512 bytes and only the first 512 bytes of reply were returned. e)	The 7th bit field indicates Recursion Desired . This bit can be set in a query and is returned in the response.     f)	The 8th bit field indicates Recursion Available or not. g)	The next 3 bits (9-11) has to be 0.     h)	The Next 4 bits (12-15) give a return code where 0 signifies No Error and 3 signifies Name Error.

3. The fields labeled Number of... give each a count of entries in the corresponding sections in the message.

4. The Question section is filled by the client and contains information about the query that is being made. Each question has a name and type associated with it.

5. The Answer, Authority, and Additional Information sections consist of a set of resource records that describe the domain names and mappings.

Insert Resource Record in DNS Database
Until now we have seen how DNS is used to find IP address of any host in the cyberspace and the use of it. Here the most important question arise is: How these resource records are inserted into DNS database. For this we consider a real time example, Lets say a company name INetwork is established and want to publish a website on internet.

The company INetwork approaches the registrar to register its domain name ‘inetwork.com’. The registrar is responsible to maintain uniqueness of domain.

The company INetwork provides the registrar with the names and IP address of their primary and secondary authority DNS server. The registrar enters the information in form of resource record and stores it into DNS database (  inetwork.com,           NS   ,     dns.inetwork.com   ) (  dns.inetwork.com,       A    ,     203.166.178.34     )

The company needs to make sure that the Type ‘A’ resource record for the their web server inetwork.com and Type ‘MX’ resource record for the company’s mail server are entered into our authority DNS server to make sure that others can access your website and employees can use the system to send mails.

Summary

 * 1) We learned the need of DNS
 * 2) How DNS is helpful, and DNS maps IP with the Domain name
 * 3) Approach to solve the query - iterative and dns... working of both.
 * 4) How caching can be helpful
 * 5) what are resource records and purpose of DNS
 * 6) How records can be inserted into DNS.

Exercise
1. How to find the IP address of any website, say google.com

Ans. C:\Documents and Settings\Richard>nslookup google.com

Server: home

Address: 192.168.1.254

Non-authoritative answer:

Name:   google.com

Addresses: 72.14.207.99, 64.233.167.99, 64.233.187.99

2. If there is a heavy traffic at the root name server to resolve the DNS request, what will happen to the DNS packet if the root name server is unable to resolve the given query?

Ans. The DNS root name server simply discards the packet.

3. Is it possible to get different IP address when you ping a website say yahoo.com? Give reason if possible?

Ans. Yes. This happens because yahoo.com is running on more than one machine, and so different machines running yahoo.com are registered into DNS. Due to this there are more than one resource records of type ‘A’ holding different IP address.

4. Can there be more than one entry in the DNS database for yahoo.com one with a type ‘A’ and other with type “MX’

Ans. Yes. It is recommended to have same domain although it is not necessary.

5.	How long a resource record can be kept in cache

Ans. The Time_To_Live field in the resource records determines how long a resource record is to be kept in cache. It is represented in terms of seconds.

de:Internet: Basics: DNS DNS en BIND Système de noms de domaine HTML/Inhoudsopgave Guia do Linux/Iniciante+Intermediário/Rede/Resolvedor de nomes (DNS)

title: Communication Networks/DNS