+INUXKW[KYZGTJXKVR_ An echo request message is sent to the destination node.. The additional fields are: • Type 8 for an echo request, and 0 for a reply • Identifier A 16-bit random nu
Trang 1The values relating the code values in the above unreachable message are as follows
Figure 6.38
Typical code messages
/)36W[KX_SKYYGMKY
In addition to the reports on errors and exceptional conditions, there is a set of ICMP messages to request information, and to reply to such request
+INUXKW[KYZGTJXKVR_
An echo request message is sent to the destination node This message essentially enquires: ‘Are you alive?’ A reply indicates that the pathway (i.e the network(s) in between, the gateways (routers)) and the destination node are all operating correctly The structure of the request and reply are indicated below
Figure 6.39
ICMP echo request and reply
The first three fields have already been discussed The additional fields are:
• Type
8 for an echo request, and 0 for a reply
• Identifier
A 16-bit random number, used to match a reply message with its associated request message
• Sequence number
Used to identify each individual request or reply in a sequence of associated requests or replies with the same source and destination
Trang 2• Data
Generated by the sender and echoed back by the echoer This field is variable in length; its length and contents are set by the echo request sender
It usually consists of the ASCII characters a, b, c, d, etc
:OSKYZGSVXKW[KYZGTJXKVROKY
This can be used to estimate to synchronize the clock of a host with that of a timeserver
Figure 6.40
Structure of the time stamp request and reply
• Type
13 for time-stamp request and 14 for time-stamp reply message
• Originate time-stamp
Generated by sender and contains a time value identifying the time the initial time-stamp request was sent
• Receive time-stamp
Generated by the echoer and contains the time the original time-stamp was received
• Transmit time-stamp
Generated by the echoer and contains a value identifying the time the time-stamp reply message was sent
The ICMP time-stamp request and reply enables a client to adjust its clock against an accurate server The times referred to hereunder 32-bit integers, measured in milliseconds
since midnight, Co-ordinated Universal Time (UCT) (Previously known as Greenwich
Mean Time (GMT))
The adjustment is initiated by the client inserting its current time in the ‘originate’ field, and sending the ICMP datagram off to the server The server, upon receiving the message, then inserts the ‘received’ time in the appropriate field
The server then inserts its current time in the ‘transmit’ field and returns the message
In practice, the ‘received’ and ‘transmit’ fields for the server are set to the same value The client, upon receiving the message back, records the ‘present’ time (albeit not within the header structure) It then deducts the ‘originate’ time from the ‘present’ time Assuming negligible delays at the server, this is the time that the datagram took to travel
to the server and back, or the round trip time (RTT) The time to the server is then
one-half of this
The correct time at the moment of originating the message at the client is now calculated by subtracting the RTT from the ‘transmit’ time-stamp created by the server The client can now calculate its error by the relationship between the ‘originate’
Trang 3stamp and the actual time, and adjust its clock accordingly By repeated application of this procedure all hosts on a LAN can maintain their clocks to within less than a millisecond of each other
9[HTKZSGYQXKW[KYZGTJXKVR_
This is used to implement a simple client-server protocol that a host can use to obtain the correct subnet mask Where implemented, one or more hosts in the internetwork are designated as subnet mask servers and run a process that replies to subnet mask request, this field is set to zero
8U[ZOTMHGYOIY
Unlike the host-to-host layer protocols (e.g TCP), which control end-to-end communications, the Internet layer protocol (IP) is rather ‘short-sighted’ Any given IP
node (host or router) is only concerned with routing (switching) the datagram to the next
node, where the process is repeated Very few routers have knowledge about the entire internetwork, and often the datagrams are forwarded based on default information without any knowledge of where the destination actually is
Before discussing the individual routing protocols in any depth, the basic concepts of IP routing have to be clarified This section will discuss the concepts and protocols involved
in routing, while the routers themselves will be discussed in Chapter 10
*OXKIZ\YOTJOXKIZJKRO\KX_
Refer to Figure 6.41 When the source host prepares to send a message to another host, a fundamental decision has to be made, namely: is the destination host also resident on the local network or not? If the NetID portions of the IP address match, the source host will assume that the destination host is resident on the same network, and will attempt to forward it locally This is called direct delivery
If not, the message will be forwarded to the local default gateway of a local router, which will forward it This is called indirect delivery The process will now be repeated
If the router can deliver it directly i.e the host resides on a network directly connected to the router, it will If not, it will consult its routing tables and forward it to the next appropriate router
This process will repeat itself until the packet is delivered to its final destination
Figure 6.41
Direct vs indirect delivery
Trang 49ZGZOI\KXY[YJ_TGSOIXU[ZOTM
Each router has a table with the following format:
Active routes for 207.194.66.100:
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
207.194.66.0 255.255.255.224 207.194.66.100 207.194.66.100 1
207.194.66.0 255.255.255.255 127.0.0.1 127.0.0.1 1
207.194.66.255 255.255.255.255 207.194.66.100 207.194.66.100 1
224.0.0.0 224.0.0.0 207.194.66.100 207.194.66.100 1
255.255.255.255 255.255.255.255 207.194.66.100 0.0.0.0 1
C:\WINDOWS.000>
It basically reads as follows: ‘If a packet is destined for network 207.194.66.0, with a Netmask of 255.255.255.224, then forward it to the router port: 207.194.66.100’, etc It
is logical that a given router cannot contain the whereabouts of each and every network in the world in its routing tables; hence it will contain default routes as well If a packet cannot be specifically routed, it will be forwarded on a default route, which should (it is hoped) move it closer to its intended destination
These routing tables can be maintained in two ways In most cases, the routing protocols will do this automatically The routing protocols are implemented in software that runs on the routers, enabling them to communicate on a regular basis and allowing them to share their ‘knowledge’ about the network with each other In this way they continuously ‘learn’ about the topology of the system, and upgrade their routing tables
accordingly This process is called dynamic routing If, for example, a particular router is
removed from the system, the routing tables of all routers containing a reference to that router will change However, because of the interdependence of the routing tables, a change in any given table will initiate a change in many other routers and it will be a
while before the tables stabilize This process is known as convergence
Dynamic routing can be further sub-classified as distance vector, link-state, or hybrid- depending on the method by which the routers calculate the optimum path
In distance vector dynamic routing, the ‘metric’ or yardstick used for calculating the optimum routes is simply based on distance, i.e which route results in the least number of
‘hops’ to the destination Each router constructs a table, which indicates the number of hops to each known network It then periodically passes copies of its tables to its immediate neighbors Each recipient of the message then simply adjusts its own tables based on the information received from its neighbor
The major problem with the distance vector algorithm is that it takes some time to converge to a new understanding of the network The bandwidth and traffic requirements
of this algorithm can also affect the performance of the network The major advantage of the distance vector algorithm is that it is simple to configure and maintain as it only uses the distance to calculate the optimum route
Link state routing protocols are also known as shortest path first protocols This is based on the routers exchanging link state advertisements to the other routers Link state advertisement messages contain information about error rates and traffic densities and are triggered by events rather than running periodically as with the distance routing algorithms
Hybridized routing protocols use both the methods described above and are more accurate than the conventional distance vector protocols They converge more rapidly to
an understanding of the network than distance vector protocols and avoid the overheads
of the link state updates The best example of this one is the enhanced interior routing protocol (EIGRP)
Trang 5It is also possible for a network administrator to make static entries into routing tables
These entries will not change, even if a router that they point to is not operational
'[ZUTUSU[YY_YZKSY
For the purpose of routing a TCP/IP-based internetwork can be divided into several autonomous systems (ASs) or domains An autonomous system consists of hosts, routers and data links that form several physical networks that are administered by a single authority such as a service provider, university, corporation, or government agency Autonomous systems can be classified under one of three categories:
• Stub AS
This is an AS that has only one connection to the ‘outside world’ and therefore does not carry any third-party traffic This is typical of a smaller corporate network
• Multi-homed non-transit AS
This is an AS that has two or more connections to the ‘outside world’ but is not setup to carry any third party traffic This is typical of a larger corporate network
• Transit AS
This is an AS with two or more connections to the outside world, and is set
up to carry third party traffic This is typical of an ISP network
Routing decisions that are made within an autonomous system (AS) are totally under the control of the administering organization Any routing protocol, using any type of routing algorithm, can be used within an autonomous system since the routing between two hosts in the system is completely isolated from any routing that occurs in other Autonomous systems Only if a host within one autonomous system communicates with a host outside the system, will another autonomous system (or systems) and possibly the Internet backbone be involved
/TZKXOUXK^ZKXOUXGTJMGZK]G_ZUMGZK]G_VXUZUIURY
There are three categories of TCP/IP gateway protocols, namely interior gateway protocols, exterior gateway protocols, and gateway-to-gateway protocols
Two routers that communicate directly with one another and are both part of the same autonomous system are said to be interior neighbors and are called interior gateways They communicate with each other using interior gateway protocols