Escolar Documentos
Profissional Documentos
Cultura Documentos
201.222.5.232~201.222.5.239
201.222.5.240~201.222.5.247
201.222.5.248~201.222.5.255
Page 149
page 135
For the network of class B, if there are 8 bits for subnet, then 256 subnets could
be provided, and 254 hosts could be included in each subnet.
Subnet bits subnet mask subnet number host number in each subnet
1 255.255.128.0 2 32766
2 255.255.192.0 4 16382
3 255.255.224.0 8 8190
4 255.255.240.0 16 4094
5 255.255.248.0 32 2046
6 255.255.252.0 64 1022
7 255.255.254.0 128 510
8 255.255.255.0 256 254
9 255.255.255.128 512 126
10 255.255.255.192 1024 62
11 255.255.255.224 2048 30
12 255.255.255.240 4096 14
13 255.255.255.248 8192 6
14 255.255.255.252 16384 2
Page 150
page 136
For the network of class C, if there are 5 bits for subnet, then 32 subnets could be
provided, and 6 hosts could be included in each subnet.
Subnet bits Subnet mask Host number in each subnet Subnet number
1 255.255.255.128 126 2
2 255.255.255.192 62 4
3 255.255.255.224 30 8
4 255.255.255.240 14 16
5 255.255.255.248 6 32
6 255.255.255.252 2 64
Page 151
page 137
A network can be divided into multiple subnets, and each subnet uses a unique
ID. But the number of hosts in every subnets may be different. If the length of
subnet mask is fixed and the number of IP addresses in the subnets is the same,
lots of IP addresses are wasted. In this case, the variable length subnet mask
(VLSM) technique can be used. If the subnet has lots of nodes, the subnet mask
could be shorter. The IP address with shorter subnet mask represents less
networks/subnets, but more IP addresses can be allocated to hosts. If the subnet
has a few nodes, the subnet mask could be longer. The IP address with longer
subnet mask represents more logical networks/subnets, but less IP addresses
can be allocated to hosts. Such addressing scheme can save lots of IP
addresses, which can be used in other subnets. As shown in the above figure, a
company deploys the IP addresses subnet planning with class C address
192.168.1.0. The company has bought five routers. One router, which works as
the gateway of the intranet, is connected to the local ISP. The other four routers
are connected to four branch offices. Each office has 20 PCs, so each office
needs 20 host addresses.
As shown in the above figure, 8 subnets are required. 4 offices need 21 IP
addresses (including a router interface). The 4 network segments connected with
the gateway need 2 IP addresses. The IP address number of every network
segment is different, so the VLSM could be used. The four network segments for
the office adopt the subnet mask 255.255.255.224, 3 bits for subnet, and 5 bits
for hosts. This means at most 25-2=30 hosts could be included. The four network
segments connecting office router and gateway, are support 6 bits for subnet,
and 2 bits for hosts, therefore at most 2 hosts could be included.
Page 152
page 138
Classless Inter-Domain Routing (CIDR), defined by RFC 1817,does not adhere
to the IP address classification. It can aggregate multiple routes into one, so to
minimize the size of the routing table and improve the scalability of the router. As
shown in the above figure, some class C networks are allocated to the ISP,
198.168.0.0-198.168.255.0. The ISP allocates the class C networks to the user
groups. At present, three class C networks have been allocated to user groups. If
the CIDR technique is not used, the routing table of the ISPs router has three
routes connected to the downlink network segments, and the routes will
advertise them to the routers on the Internet. By the CIDR technique, the three
routes 198.168.1.0, 198.168.2.0, and 198.168.3.0 can be aggregated into one
route 198.168.0.0/16. Thus, the ISPs router advertises only route 198.168.0.0/16
to the Internet, and the number of entries in the routing table is reduced. It should
be noted that the number of bits of the network addresses aggregated by CIDR
must be the same. As shown in the above figure, if the ISP is connected to
network segment 172.178.1.0, then the routes of the network segments cannot
be
aggregated.
Page 153
page 139
Page 154
page 140
Address Resolution Protocol (ARP) is a broadcast protocol, through which the
host can dynamically find the corresponding MAC address of an IP address.
Every host has an ARP cache, with the mapping table between IP address and
physical address, which are currently known by the host. When host A wants to
send an IP packet to host B in the same LAN, it will first look up the ARP cache
to find whether there is IP address of host B in the table. If so, the corresponding
physical address could be found, and to send the data packet according to the
physical address.
Sometimes, the corresponding IP address of host B cannot be found. It is
possibly because host B just joined the network, or host A has just powered and
on whose ARP cache is empty. In this case, suppose host A needs to know the
MAC address of host B. host A will send ARP Request to every host in the
network segment by broadcast. In the ARP Request, the mapping information of
its own IP address to MAC address is contained, as well as the destination IP
address needs to be resolved. When the destination host B receives the request
packet, it stores the mapping information of host A into its ARP cache, and sends
its own mapping information from IP to MAC address back to host A. After host A
receives the ARP Reply, it obtains the MAC address of host B. At the same time,
host A puts the mapping information of host B into its ARP cache.
Page 155
page 141
The function of Proxy ARP is to make hosts or routers in different networks segment can
communicate. Usually, when a router R receives an ARP Request, it will check whether
the requested destination address is its own: if so, the ARP Reply will be sent; if not, the
request packet is discarded.
However, if the router R enables the Proxy ARP function, when router R receives an ARP
Request, and finds the destination address is not its own, router R will not discard the
packet immediately. Instead, router R looks up the routing table, if there is a route to this
destination, it will send its own MAC address to the request party, and the request party
will send the packet with this destination to router R, and router R will forward it further.
Page 156
page 142
Gratuitous ARP: The host sends ARP Request to find the corresponding MAC
address of its own IP address. If in the network, there is no another host with the
same IP address, the host will not receive any reply. However, if the host
receives reply, it indicates that another host in the network is configured with the
same IP address. Hence, in the terminal log of host, an error information will be
created, indicating that a duplicate IP address is configured.
Functions of Gratuitous ARP:
1. Through sending Gratuitous ARP packets, it could be confirmed whether there
is IP address conflict in the network. If the Request party receives a Gratuitous
ARP reply, it indicates that there is an equipment with a duplicate IP address.
2. Updating the old hardware address information. If the host sending Gratuitous
ARP just changes its hardware address, such as changing network card, the
Gratuitous ARP could be used to update the old hardware address information.
When the receiving party receives an ARP Request, and this ARP information
already exists in the ARP table, then the receiving party must update the old
ARP information table, using the address information in the new ARP Request.
Page 157
page 143
Sometimes, RARP ( Reverse Address Resolution Protocol) is needed when dealing with
diskless workstations. This equipment knows its own MAC address, and needs to obtain
IP address. In order to make RARP work properly, in the LAN, at least one host has to be
the RARP Server. In this example, the diskless workstation needs its own IP address. It
broadcasts the RARP Request in the network. The RARP Server receives this broadcast
request, and sends the reply. Thus, the diskless workstation will obtain the IP address.
Similarly with ARP Request, RARP Request are sent using broadcasts, ARP Reply and
RARP Reply are usually forwarded as unicast packets
Page 158
page 144
Page 159
page 145
The main function of a router is to interconnect different networks. The data must
also be capable of being forwarded to the Internet.
Data forwarding: A router should have the ability to forward data packets
according to the destination address of data packets.
Routing: In order to forward data packets, the router should have the ability to
establish, update and forward data packets based on routing table.
Backup, traffic flow control: In order to guarantee the reliability of network,
usually, the router has the ability to switch to backup link and the function of
traffic flow control.
Speed adapting: Different interfaces have different speeds, the router can
implement the adjustment according to its buffer and other flow control protocols.
Isolating network: The router can isolate broadcast network and prevent
broadcast storms. At the same time, it can apply flexible filter policy to the data
packet, to guarantee network security.
Interconnecting heterogeneous networks: Presently, at least two kinds of
network protocols could be implemented in the router to interconnect
heterogeneous networks. For example, routers that support ATM and FR
interfaces can be considered as belonging to a router that can interconnect
heterogeneous networks.
Page 160
page 146
The slide shows the working process of a router:
At the physical layer, the packet is received by one of the router interfaces, and is sent to
the upper layer which is data link layer. The Data Link Layer will de-encapsulate the
frames, and send to the Network Layer based on the protocol field of the packets. The
network layer will firstly check whether the packet is intended for the local host.
If so, the network layer encapsulation is de-encapsulated, and the packet is sent to upper
layer. If not, the router will check the routing table according to the destination address of
the packet. If a route item could be found, the packet is sent to data link layer of the
corresponding port, after the encapsulation of data link layer, the packet is sent. If no
route could be found, the packet will be discarded, and relative error information would be
sent to the source of the packet.
Page 161
page 147
The ability to forward data packets is due to the routing table. Every router
maintains a routing table, in which every route indicates the corresponding
physical port of the router through which the destination subnet or host could be
reached. In the routing table, the following key items are included:
Destination: It is used to identify the destination address or network of the IP
packet.
Mask: Together with the destination address, it is used to identify the network
segment address in which the destination host or router is located. After
implementing logical AND to the destination address and network mask, the
network segment address could be obtained in which the destination host or
router is located.
Interface: Indicates to the current router, through which interface the IP packet is
to be forwarded.
Next Hop: Indicates the interface address of the next router through which the IP
packet should pass.
Page 162
page 148
1. What is IP address classification?
IP addresses are divided into Classes A, B, C, D and E. Among them, Class D is
multicast address; Class E is reserved address. In Class A, B, and C, each has
its own private address space.
2. What is the function of ARP/RARP?
ARP stands for Address Resolution Protocol, which is used to analyze the
corresponding MAC address for an IP address; RARP stands for Reverse
Address Resolution Protocol, which is used to analyze the corresponding IP
address for a MAC address.
3. What is the principle function of a router?
At the physical layer, the packet is generally received by one of the router
interfaces, and is sent to the upper layer, namely the data link layer. The data
link encapsulation is de-encapsulated, and according to the protocol field of
packets, it is sent to network layer. For network layer, first of all, it checks
whether the packet is intended for the local host. If so, the network layer
encapsulation is decapsulated, and the packet is sent to the upper layers. If not,
the router will check the routing table according to the
destination address of the packet. If a route item could be found, the packet is
sent to data link layer and the corresponding interface, after the encapsulation of
data link
layer, the packet is forwarded. If no route could be found, the packet will be
discarded, and relative error information would be sent to the packets source.
Page 163
page 149
page 150
Page 167
page 153
Page 168
page 154
Page 169
page 155
Page 170
page 156
VRP is the network operation system used by Huawei based routing & switching products.
VRP can be used as general software platform of all Huaweis network devices to
provide TCP/IP routing services. Currently version 5.7 is used for many products.
Page 171
page 157
VRP adopts componentized architectureVRP is made up of five planes: GCP, SCP DFP
SMP and SSP.
For example, GCP is General Control Plane, it supports internet protocols such as IPv4
and IPv6. The protocols and functions that GCP supports include SOCKET, TCP/IP, route
management, routing protocols and so on VRP just needs to add or delete corresponding
planes to fit different switch or router functionality.
Page 172
page 158
Page 173
page 159
At present, Huaweis routers and switches support three configuration modes, two of which
are listed as follows:
Local configuration through the Console port
Local or remote configuration through Telnet
Page 174
page 160
You can build a configuration environment only through the Console port for the two
following occasions:
(1)The router is powered on for the first time. There is only default configuration
(2) You can directly connect the device
The procedures of configuring a router through the Console port are as follows:
Procedure 1: Connect the console cable
(1) Connect the RJ45 connector to the Console port of the router.
(2) Connect the 9-pin or 25-pin RS232 connector to the serial port (COM) of the computer.
Page 175
page 161
Procedure 2: Create the super terminal
(1)Run the terminal emulation program, for example, Super Terminal of WIN XP,
on the PC.
2Click Start > Program > Communication > Super Terminal
3Input any characters as the name after New Connection appears and choose a COM
connection and click OK, then a page as above appears. The port settings should be
configured in accordance with the image, then click OK
Page 176
page 162
If it is not the first time for the router to be powered on and you cannot directly connect to the
router console port, it may be possible depending on the current device configuration settings,
to use TELNET to enter the device. There are two methods you may use to configure the
router, either from a PC through the local network to directly Telnet to the router from a PC
using a console connection to a router (e.g. router1), and then Telnet from this router to
another router. The device running the VRP system operation can serve as a TELNET client.
Page 177
page 163
For the PC to use Telnet to reach the Telnet server requires two conditions to be met
1Client and server must be able to communicate
2The server is configured to allow clients to use the Telnet service establish a session.
In the example given, the configuration is represents the router configuration that is acting
as the Telnet server. The initial step requires configuration of the router Ethernet interface,
to make sure the client and the server (router) can communicate. The second step involves
configuration of the VTY interface including selecting the password mode as the
authentication mode of Telnet, setting user permission level.
Page 178
page 164
Page 179
page 165
After accessing the router, the user will be given the prompt in user view. It is from here
that the user can switch to the system view by entering the System-view command. It is
then possible to enter views of other services by running corresponding commands in the
system view. Commands that can be run in different views can be seen listed in the graphic.
Page 180
page 166
When accessing the device for the first time, all users will start off in the user view, from
where users can switch to the system view using the System-view command. The system
view can be switched back to the user-view after entering the quit command. It is possible
to return to the user view from any view by entering the return command or using the
composite key command <Ctrl+Z>.
For example
#Enter the system view from the user view.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z
#Enter the interface view from the system view.
[Quidway]interface Serial 0/0/0
[Quidway-Serial0/0/0]
#Return to the system view from the interface view.
[Quidway-Serial0/0/0]quit
[Quidway]
#Return to the user view from the system view.
[Quidway]return
<Huawei>
Page 181
page 167
In this example, through using the ? command, it is possible to obtain a brief of all the
commands at a given level. All levels will support the use of this command to display
possible completions. Another use of this command will allow for completion based on
matches to a partial entry. If only the first letter of a command can be recalled, the ?
command can be inserted as shown in the example above, in order to obtain all the
commands with the same matching parameters, in this case, the same first letter.
Page 182
page 168
VRP supports two languages and allows users to enter the language-mode command to
switch between the two languages. The procedure is as follows:
<Huawei>language-mode ?
chinese Chinese environment
english English environment
<Huawei>language-mode chinese
Change language mode, confirm? [Y/N]y
Info:Switchto the Chinese mode.
<Huawei>
Page 183
page 169
The command line interface automatically stores commands input by users which so that
users can recall used commands at any time and repetitively. By default,
the command line interface can keep records of up to 10 commands for a user.
display history-command:
To display the commands that a user has input.
Up-arrow key or <Ctrl+P>:
Display the earlier record if there is one; otherwise the alarm goes off.
down-arrow key or <Ctrl+N>:
Display the next record if there is one; otherwise, the command is cleared up and the alarm
goes off.
When you use the command record function, please note the following:
(1) The format of command records kept by VRP complies with the format of commands
input by users. If the format of commands input by users is not intact,
then the format of commands kept by VRP is not intact either.
(2) If a command is run by a user for many times, VRP only keeps the first running of this
command as record. If a command is run in different formats several times, it is treated as
different commands. For example, if you run the display ip routing-table command
several times, VRP will keep it as only one record. If you run disp ip routing and display
ip routing-table, VRP will keep them as two records.
Page 184
page 170
Do as following to change the name of a router:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]
[Quidway]sysname Router1
[Router1]
Page 185
page 171
Some services require that there be synchronization of time with other devices, often as a
security measure and therefore the system time should be set correctly.
VRP supports the setting of the time zone and daylight savings time features.
#Set the time.
<Huawei>clock datetime 10:19:30 2006/12/12
<Huawei>
<Huawei>display clock
10:19:36 UTC Tue 2006/12/12
<Huawei>
Page 186
page 172
You can display the VRP version information by running the display version command.
<Router>display version
Huawei Versatile Routing Platform Software
VRP WVRP-CEN Software Version VRPV5R1B12D054
Copyright (c) 2003-2010 by VRP Team Beijing Institute Huawei Tech, Inc
Page 192
page 178
VRP can backup its software and configuration files through FTP, TFTP and XMODEM.
Here we will introduce the basic operations for routers or switches to obtain version files
through the three modes, which is the general knowledge about version update. For details
about version update methods and procedures, please refer to the update guidelines we
provide for a product or a specific version of a product.
FTP, TFTP and XMODEM are all file transport protocols for transporting files between
users and devices.
File Transfer Protocol (FTP) is based on TCP and takes the mode of Server/Client. VRP
can act both as the FTP server and the FTP client. When it acts as the FTP server, users
can log in to the router to visit files on the router by running the FTP client program. When
VRP acts as the FTP client, users can run FTP commands to connect with the remote FTP
server and then visit files on the remote host after they built connections with the router
through the terminal emulation program or Telnet.
Trivial File Transfer Protocol (TFTP), different from FTP, does not require any
authentication mechanisms, which is fit for an environment that does not involve much
interaction between clients and servers. TFTP is based on UDP and takes the mode of
Server/Client. TFTP transfer is initiated by the client. When there are
files to download, the client sends requests to the TFTP server for reading the files and
receives packets from the server and at last, it sends confirmation to the
server. When there are files to upload, the client sends requests to the TFTP server for
writing the files and sends packets to the server and at last, it sends confirmation to the
server. TFTP files have two modes, one is the binary mode that is used for program files
and the other is the ASCII mode that is for text files.
VRP can only act as the TFTP client and can transfer files only in the binary mode.
XModem protocol transfers files through serial ports, which is widely used for its simplicity
and capabilities. VRP supports receiving program through XModem
which can be applied to the AUX interface.
Page 193
page 179
As the above figure illustrates, the PC and Router A are connected through serial ports
and Router A and the FTP server are connected to the LAN. Router A
obtains version files from the FTP server as the FTP client. Set the username and
password to quidway and huawei respectively on the FTP server. Log in to Router A from
the PC by the super terminal and make the following operations to obtain version files.
#Log in to the FTP server from Router A.
<Router> ftp 172.16.104.110
Trying 172.16.104.110 ...
Connected to 172.16.104.110.
User(172.16.104.110:(none)):quidway
331 Give me your password, please
Password:
230 Logged in successfully
#Obtain the version file vrp.cc from the FTP server by running the get command.
[ftp] get vrp.cc