Thursday, February 12, 2009

C++ Character Functions

The C++ char functions are extremely useful for testing and transforming characters. These functions are widely used and accepted. In order to use character functions header file is included into the program. Some of the commonly used character functions.
isalnum()- The function isalnum() returns nonzero value if its argument is either an alphabet or integer. If the character is not an integer or alphabet then it returns zero.

isalpha() - The function isalpha() returns nonzero if the character is an uppercase or lower case letter otherwise it returns zero.

iscntrl() - The function iscntrl() returns nonzero if the character is a control character otherwise it returns zero.

isdigit()- The function isdigit() returns nonzero if the character is a digit, i.e. through 0 to 9. It returns zero for non digit character.

isgraph()- The function isgraph() returns nonzero if the character is any printable character other than space otherwise it returns zero.

islower()- The function islower() returns nonzero for a lowercase letter otherwise it returns zero.

isprint()- The function isprint() returns nonzero for printable character including space otherwise it returns zero.

isspace()- The function isspace() returns nonzero for space, horizontal tab, newline character, vertical tab, formfeed, carriage return; otherwise it returns zero.

isxdigit() - The function isxdigit() returns nonzero for hexadecimal digit i.e. digit from 0 to 9, alphabet 'a' to 'f' or 'A' to 'F' otherwise it returns zero.


Here is a program which illustrates the working of character functions.



#include

#include

using namespace std;



int main ()

{

char ch='a';

char ch1='Z';

char ch2=' ';

char ch3='0';

char ch4='?';

char ch5='F';

if(isalpha(ch))

{

if(islower(ch))

{

cout << "The character 'a' is an lower case letter." << endl;

}

}

if(isupper(ch5))

{

if(isxdigit(ch5))

{

cout << "The character 'F' is a upper case letter and hexadecimal digit" << endl;

}

}

if(isalnum(ch3))

{

if(isdigit(ch3))

{

cout << "The character '0' is an alphanumeric character and a digit" << endl;

}

}

if(isprint(ch2))

{

if(isspace(ch2))

{

if(isgraph(ch2))

{

cout << "The character is a graphic character" << endl;

}

else

{

cout << "The character " " is a printable character and space" << endl;

}

}

}

if(ispunct(ch4))

{

cout << "The character '?' is a punctuation character" << endl;

}

cout << "The uppercase letter of 'a' is : " << static_cast(toupper(ch)) << endl;

return(0);

}



The result of the program is:-



program output



The statement



#include

I

includes a header file into the program. The statement



if(isalpha(ch))



checks whether character ch is alphanumeric. It returns nonzero value as 'a' is alphanumeric. The statement



if(islower(ch))



checks whether character ch is a lower case letter. It returns nonzero value as 'a' is lower case letter. The statement



if(isupper(ch5))



checks whether character ch5 is a upper case letter. It returns nonzero value as 'F' is a upper case letter. The statement



if(isxdigit(ch5))



checks whether character ch5 is a hexadecimal digit. It returns nonzero value as 'F' is a hexadecimal digit. The statement



if(isalnum(ch3))



checks whether character ch3 is a alphanumeric character. It returns nonzero value as '0' is an alphanumeric character. The statement



if(isdigit(ch3))



checks whether character ch3 is a digit. It returns nonzero value as '0' is digit. The statement



if(isprint(ch2))



checks whether character ch2 is a printable character . It returns nonzero value as character ch2 ' ' is a printable character. The statement



if(isspace(ch2))



checks whether character ch2 is a space character . It returns nonzero value as character ch2 ' ' is space. The statement



if(isgraph(ch2))



checks whether character ch2 is a graphical character . It returns zero value as character ch2 is not a graphical character. The statement



if(ispunct(ch4))



checks whether character ch4 is punctuation character. It returns nonzero value as character ch4 '?' is a question mark. The statement



cout << "The uppercase letter of 'a' is : " << static_cast(toupper(ch)) << endl;



displays the upper case equivalent of letter 'a'. The function toupper(ch) converts lower case letter to upper case letter and it returns integer value therefore type casting is used to convert integer type value to character type value. If type casting is not used then it will return the ASCII code of upper case letter.

Friday, January 23, 2009

Setting Switch

Router 1
hostname R1 !
enable secret class !
no ip domain lookup !
interface FastEthernet0/0
ip address 172.17.50.1 255.255.255.0
no shutdown !
interface FastEthernet0/1
no shutdown !
interface FastEthernet0/1.1
encapsulation dot1Q 1
ip address 172.17.1.1 255.255.255.0 !
interface FastEthernet0/1.10
encapsulation dot1Q 10

ip address 172.17.10.1 255.255.255.0
!
interface FastEthernet0/1.20
encapsulation dot1Q 20
ip address 172.17.20.1 255.255.255.0
!
interface FastEthernet0/1.30
encapsulation dot1Q 30
ip address 172.17.30.1 255.255.255.0
!
interface FastEthernet0/1.99
encapsulation dot1Q 99 native
ip address 172.17.99.1 255.255.255.0
!

!
line con 0
line aux 0
line vty 0 4
login
password cisco
!

LAN Switching and Wireless: Inter-VLAN Routing Lab 6.4.1: Basic Inter-VLAN Routing
Switch 1
!
hostname S1
!
enable secret class
!
no ip domain lookup
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/5
no shutdown
!

!
interface Vlan1
no ip address
no ip route-cache
!
interface Vlan99
ip address 172.17.99.11 255.255.255.0
no shutdown
!
ip default-gateway 172.17.99.1
ip http server
!
line con 0
logging synchronous
line vty 0 4
login
password cisco
line vty 5 15
login
password cisco
!
end
Switch 2
!
hostname S2
!

LAN Switching and Wireless: Inter-VLAN Routing Lab 6.4.1: Basic Inter-VLAN Routing
enable secret class
!
no ip domain lookup
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/5
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/6
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 30
!
interface FastEthernet0/8
switchport access vlan 30
!
interface FastEthernet0/9
switchport access vlan 30
!
interface FastEthernet0/10
switchport access vlan 30
!
interface FastEthernet0/11
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/12
switchport access vlan 10
!
interface FastEthernet0/13
switchport access vlan 10
!
interface FastEthernet0/14
switchport access vlan 10
!
interface FastEthernet0/15
switchport access vlan 10
!
LAN Switching and Wireless: Inter-VLAN Routing Lab 6.4.1: Basic Inter-VLAN Routing
interface FastEthernet0/16
switchport access vlan 10
!
interface FastEthernet0/17
switchport access vlan 10
!
interface FastEthernet0/18
switchport access vlan 20
!
interface FastEthernet0/19
switchport access vlan 20
!
interface FastEthernet0/20
switchport access vlan 20
!
interface FastEthernet0/21
switchport access vlan 20
!
interface FastEthernet0/22
switchport access vlan 20
!
interface FastEthernet0/23
switchport access vlan 20
!
interface FastEthernet0/24
switchport access vlan 20
!
interface Vlan1
no ip address
no ip route-cache
!
interface Vlan99
ip address 172.17.99.12 255.255.255.0
no shutdown
!
ip default-gateway 172.17.99.1
ip http server
!
line con 0
password cisco
logging synchronous
login
line vty 0 4
password cisco
login
line vty 5 15
password cisco
login
!
end
Switch 3
!
hostname S3

Design an IP addressing scheme.

Given the IP address block of 192.168.7.0 /24, design an IP addressing scheme that satisfies the
following requirements:
Subnet Number of Hosts
Subnet A 110
Subnet B 54
The 0 subnet is used. No subnet calculators may be used. Create the smallest possible subnets that
satisfy the requirements for hosts. Assign the first usable subnet to Subnet A.
Subnet A
Specification Student Input
Number of bits in the subnet 1
IP mask (binary) 11111111. 11111111. 11111111.10000000
New IP mask (decimal) 255.255.255.128
Maximum number of usable
subnets (including the 0 subnet)
2
Number of usable hosts per
subnet
126
IP subnetwork address 192.168.7.0
First IP host address 192.168.7.1
Last IP host address 192.168.7.126
Subnet B
Specification Student Input
Number of bits in the subnet 2
IP mask (binary) 11111111. 11111111.
11111111.11000000
New IP mask (decimal) 255.255.255.192
Maximum number of usable subnets
(including the 0 subnet)
2
Number of usable hosts per subnet 62
IP network address 192.168.7.128
First IP host address 192.168.7.129
Last IP host address 192.168.7.190
Host computers will use the first usable IP address in the subnet. The network router will use the last
usable IP address in the subnet.
Step 2: Write down the IP address information for each device.
Device IP address Mask Gateway
Host1 192.168.7.1 255.255.255.128 192.168.7.126
Router1-Fa0/0 192.168.7.126 255.255.255.128 -------------
Host2 192.168.7.129 255.255.255.192 192.168.7.190
Router1-Fa0/1 192.168.7.190 255.255.255.192 -------------
Table 1. IP Address Assignments
Before proceeding, verify your IP addresses with the instructor

CCNA Exploration: Network Fundamentals (Guided Case Study)

In order to send/receive packet through a data computer network, 2 types of addresses are necessary: Layer 2 and Layer 3 network addresses. (also known as L2 and L3 addresses)
While L2 addresses have a local scope, which allows another device to have the same L2 address in a different network segment, L3 addresses have a global scope. A L3 address assigned to a device must be unique all over the internet during the time this device is connected to the network.
In order to achieve data delivery, L2 addresses are (statically or dynamically) mapped to L3 addresses.
The address resolution protocol (arp) is a protocol used by the Internet Protocol (IP) [RFC826], specifically IPv4, to dynamically map IP network addresses (L3 addresses) to the hardware addresses (L2 addresses) used by a data link protocol. The protocol operates below the network layer as a part of the interface between the OSI network and OSI link layer. It is used when IPv4 is used over Ethernet.
The Internet Control Message Protocol (ICMP) is used by send error and control messages between devices. ICMP is a TCP/IP Network Layer protocol, first defined in RFC 792, September, 1981. ICMP message types were later expanded in RFC 1700. An extremely useful application called ping uses ICMP as the main protocol.
Task 1: Scenario
In this task, you will be asked to address and ping the devices on the same network. After the addressing is done, you will learn more about the arp protocol.
Task 1: Address the PCs
On your work PC, run the Packet Tracer 4.1 and load the ccna_discovery_cs_task1.pkt topology file into it; It contains 3 PCs connected to a switch. Once the file is loaded and you can see the topology, assign IP addresses and subnet masks to the PCs. Don’t worry about the DNS and default gateway for now. The PCs IP Addresses must match the table below:
PC1:
IP Address: 192.168.10.11
Subnet Mask: 255.255.255.0
PC2:
IP Address: 192.168.10.12
Subnet Mask: 255.255.255.0
PC3:
IP Address: 192.168.10.13
Subnet Mask: 255.255.255.0
Note: Since the addresses are being specified by you, the Static option must be chosen.
The topology is shown below:
Task 1: Verifying the addresses on the PCs
Once you have all the addresses assign to the PCs, check their addresses using the command ipconfig /all. The output of this command shows the L2 and the L3 address assign to the PC.
While the L3 address was assign by you, the L2 address was acquired from the network installed on the PC. The output of that command when issued on PC1 should look like this:
PC>ipconfig /all
Physical Address............: 00D0.BC00.5910
IP Address......................: 10.10.10.11
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 0.0.0.0
DNS Servers.....................: 0.0.0.0
PC>
On the output above the Physical Address line shows the L2 address of PC1
The IP Address line shows the L3 address of PC1, which was assigned by you.
Note: Since Packet Tracer is a simulation program, the PC’s Physical Addresses might be different on your system than the ones showed here.
Question 1: List the L3 and L2 addresses of the PCs.
Task 1: Ensuring Connectivity
ping operation is straight forward. The source computer sends an ICMP echo request to the destination. The destination responds with an echo reply. If there is a break between the source and destination, a router may respond with an ICMP message that host unknown or destination network unknown.
Ensure the PCs are able to reach each other by using the ping command. From each PC, ping the other 2 to ensure connectivity:
From PC1:
PC>ping 10.10.10.12
Pinging 10.10.10.12 with 32 bytes of data:
Reply from 10.10.10.12: bytes=32 time=157ms TTL=120
Reply from 10.10.10.12: bytes=32 time=75ms TTL=120
Reply from 10.10.10.12: bytes=32 time=94ms TTL=120
Reply from 10.10.10.12: bytes=32 time=84ms TTL=120
Ping statistics for 10.10.10.12:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 75ms, Maximum = 157ms, Average = 102ms
PC>
PC>ping 10.10.10.13
Pinging 10.10.10.13 with 32 bytes of data:
Reply from 10.10.10.13: bytes=32 time=67ms TTL=120
Reply from 10.10.10.13: bytes=32 time=82ms TTL=120
Reply from 10.10.10.13: bytes=32 time=84ms TTL=120
Reply from 10.10.10.13: bytes=32 time=70ms TTL=120
Ping statistics for 10.10.10.13:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 67ms, Maximum = 84ms, Average = 75ms
PC>
From PC2:
PC>ping 10.10.10.11
Pinging 10.10.10.11 with 32 bytes of data:
Reply from 10.10.10.11: bytes=32 time=73ms TTL=120
Reply from 10.10.10.11: bytes=32 time=86ms TTL=120
Reply from 10.10.10.11: bytes=32 time=77ms TTL=120
Reply from 10.10.10.11: bytes=32 time=89ms TTL=120
Ping statistics for 10.10.10.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 73ms, Maximum = 89ms, Average = 81ms
PC>
PC>ping 10.10.10.13
Pinging 10.10.10.13 with 32 bytes of data:
Reply from 10.10.10.13: bytes=32 time=136ms TTL=120
Reply from 10.10.10.13: bytes=32 time=86ms TTL=120
Reply from 10.10.10.13: bytes=32 time=77ms TTL=120
Reply from 10.10.10.13: bytes=32 time=77ms TTL=120
Ping statistics for 10.10.10.13:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 77ms, Maximum = 136ms, Average = 94ms
PC>
From PC3:
PC>ping 10.10.10.11
Pinging 10.10.10.11 with 32 bytes of data:
Reply from 10.10.10.11: bytes=32 time=91ms TTL=120
Reply from 10.10.10.11: bytes=32 time=70ms TTL=120
Reply from 10.10.10.11: bytes=32 time=84ms TTL=120
Reply from 10.10.10.11: bytes=32 time=71ms TTL=120
Ping statistics for 10.10.10.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 70ms, Maximum = 91ms, Average = 79ms
PC>
PC>ping 10.10.10.12
Pinging 10.10.10.12 with 32 bytes of data:
Reply from 10.10.10.12: bytes=32 time=96ms TTL=120
Reply from 10.10.10.12: bytes=32 time=88ms TTL=120
Reply from 10.10.10.12: bytes=32 time=86ms TTL=120
Reply from 10.10.10.12: bytes=32 time=95ms TTL=120
Ping statistics for 10.10.10.12:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 86ms, Maximum = 96ms, Average = 91ms
PC>
Task 2: Connecting to a Server
Task 2: Scenario
On Task 2 will learn more about clients and servers by placing a request from a client to a server. This task will use the HTTP as the illustrative protocol spoken between the client and the server.
Task 2: Preparing the Devices
In computer networks a very common structure is a Client-Server structure. In this structure, the device which requests information is called a client and the server which provides the information is called Server.
Run the Packet Tracer 4.1 program and load the ccna_discovery_cs_task2.pkt file into it.
The topology is also shown below:
On this topology the PC1 will act as a client and the Server1 will act as a server. In order to have connectivity between PC1 and Server1, assign L3 addresses to PC1 and to Server1 according to the table below:
PC1: 10.10.10.11
Subnet Mask: 255.255.255.0
Server1: 10.10.10.25
Subnet Mask: 255.255.255.0
Note: Again, chose the Static as address type and don’t worry about the DNS and default gateway information for now.
The Once the addresses were assigned, issue a ping command from PC1 to Server 1.
Task 2: Ensuring connectivity
The http protocol will be protocol spoken between the client and the server during this task. Since HTTP is a layer 7 protocol, ensure connectivity on the lower layers before start the upper layers communication.
Which command can be used to ensure connectivity on the lower layers?
Answer: The ping command. When a successful ping is issued, the layers 2 and 3 connectivity is ensured.
From PC1, ping Server1.
PC>ping 10.10.10.25
Pinging 10.10.10.25 with 32 bytes of data:
Reply from 10.10.10.25: bytes=32 time=69ms TTL=120
Reply from 10.10.10.25: bytes=32 time=90ms TTL=120
Reply from 10.10.10.25: bytes=32 time=97ms TTL=120
Reply from 10.10.10.25: bytes=32 time=91ms TTL=120
Ping statistics for 10.10.10.25:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 69ms, Maximum = 97ms, Average = 86ms
As showed above, the ping should be successful. If it was not, double check the addresses assigned to PC1 and to Server1.
Task 2: Requesting a HTTP page from the Server
Since the ping command from PC1 to Server1 was successful, it is safe to state that the lower layers connectivity was achieved. The network is now ready to support the upper layer protocols traffic.
Open a web browser on PC1, type the Server’s 1 ip address on it (10.10.10.25) and press enter. You should see a web page stored at Server1.
PC1, acting as a HTTP client, sends a HTTP request to Server1 asking for a web page located on that server. Since HTTP protocol uses the TCP protocol on port 80, this request is sent as TCP packet from PC1 to the Server1’s port 80.
Server1 is running HTTP server software and thus, is ready to respond HTTP requests. After Serve1 receive the HTTP packet from PC1, it interprets the request and answers properly. PC1 receives a TCP packet from Serve1 containing a web page and shows it on the web browser window. PC1 acted as client and requested information. Server1 acted as server and provided a response regarding the PC1’s request.
Task 2: The ARP Protocol
In order to send packets, the source and the destination devices must learn their L2 addresses and map it to the respective L3 address. Since this is an Ethernet environment, the L2 address is the MAC address.
The ARP protocol provides a way to dynamically map L2 to L3 addresses by querying all the devices on the segment about their L2 addresses. Suppose PC1 is trying to send data to PC3, below is a summary of the ARP protocol operation:
1. PC1 needs to know the MAC address of the PC3 before it can send any data. PC1 sends a broadcast packet out on the network. This packet has the question “Who has the IP address 10.10.10.13?” (10.10.10.13 is the IP address of PC3). This packet is known as ARP request.
2. PC2 receives the question but, since PC2’s IP address is 10.10.10.12 (and not 10.10.10.13), PC2 does not answer the question. The reason why PC2 receives the packet is the packet was a broadcast.
3. PC3 also receives the packet. PC3 checks the question the answers it because 10.10.10.13 is PC3’s IP address.
4. PC3 sends an UNICAST packet back to PC1 saying: “Hey, this PC3. I have 10.10.10.13 and my MAC address is: 000D.BD62.D826. This answer is known as ARP reply
5. Now PC1 has PC3’s MAC address and PC3 has PC1’s MAC address and the data communication between PC1 and PC3 can take place.
Notice that:
- Even though the process was initiate by PC1, at the end PC3 also knows PC1 MAC address. This is a feature of the ARP protocol. It assumes since PC1 needed PC3’s MAC address, chances are PC3 will send data to PC1 shortly and thus, PC3 also stores PC1’s MAC address. This keep PC3 to start a new ARP query to learn PC1’s MAC address.
- PC2 has no information about PC1 or PC3 MAC addresses because the process did not include PC2.
The ARP protocol keeps a table on the device’s memory called ARP table. This table maps L3 addresses to L2 address of the devices to which the local device sends data.
Task 2: The ARP table
The arp -a command can be issued on the PCs in order to list their ARP table.
Check the ARP table on PC1, PC2 and PC3 and answer the questions below.
At this point, what is the content of PC1, PC2 and PC3 ARP table?
Answer: Since no packets were sent or received, all three PCs should have empty ARP Tables.
Obs: Due the last step of Task2, PC1 might still have the Server1 entry on its Arp Table. It will depend on the amount of time since the last data packet was sent from PC1 to Server1.
From PC1, ping PC3. The ping should be successful.
Check the ARP table on PC1, PC2 and PC3 again and answer the questions below:
List the content of PC1 and PC3’s ARP table.
Answer: PC1 has an entry regarding PC3 and PC3 has an entry regarding PC1.
What is the content of PC2’s ARP table? Why?
Answer: No packets were sent to PC2, thus its ARP Table is empty.
Task 3: Getting out of the Local Network
Since the L2 addresses are unique within the same segment, within the same local network (local scope) why is the L3 addresses necessary?
Answer: L3 addresses are necessary mostly when sending packets to networks other than the local network. The source device, when sending data to a remote network, uses the L2 address to specify the intermediate (for routing purposes only) and the L3 address to specify the final destination of the data (usually a application)
So far all the packets were sent/received to/from devices within the same local network. The necessity of an upper layer address, a L3 address, rises when data must be sent to remote networks.
Run Packet Tracer 4.1 and load the ccna_discovery_cs_task3.pkt file. The topology is shown below:
When a packet must be sent out of the local network, an intermediate device must be used. Such device must be connected to the local network and to the remote network. This intermediate device is called router or gateway. (The term Gateway is more often used from the PCs viewpoint)
Obs: Usually, the intermediate device is not directly connected to the remote network. In those cases, it must have a path (or a route) through another intermediate device to reach the remote network. The process of learning paths and choosing the best one is called routing.
From PC1, ping the PC3 computer. The ping should be successful.
PC>ping 10.10.10.13
Pinging 10.10.10.13 with 32 bytes of data:
Reply from 10.10.10.13: bytes=32 time=67ms TTL=120
Reply from 10.10.10.13: bytes=32 time=82ms TTL=120
Reply from 10.10.10.13: bytes=32 time=84ms TTL=120
Reply from 10.10.10.13: bytes=32 time=70ms TTL=120
Ping statistics for 10.10.10.13:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 67ms, Maximum = 84ms, Average = 75ms
PC>
Check PC1’s ARP table.
PC>arp -a
What is the address listed on PC1’s ARP table?
Answer: PC1 has an entry regarding PC3
Now, still from PC1, ping Server2 (20.20.20.25)
PC>ping 20.20.20.25
Pinging 20.20.20.25 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 20.20.20.25:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
PC>
Why PC1 is able to ping PC3 but it is not able to ping Server2?
Answer: No default gateway was defined on the PC1’s configuration
A Default Gateway is an intermediate device used when the destination device lies in a remote network. The local device concludes the destination device is not on the same network and thus the data must be forwarded to a third intermediate device, an endpoint device. This device is called Default Gateway.
PC1 has no default gateway information configured on it and thus is not able to reach any device which is not on its local network.
On the topology shown above, Router1 (10.10.10.1) is the default gateway for the PC1’s network. When Router receives a packet from PC1, it checks the destination IP address of the packet. Since the destination IP address is Server2’s IP address and not Router1’s IP address, Router1 understands it must route the packet. Router1 search its routing table looking for a matching route to the destination 20.20.20.25. Router1 finds a route to the network 20.20.20.0/24 via fa0/0 and forward the packet through that interface.
Open the PC1’s configuration tab and let Router1 (10.10.10.1) be PC1’s default gateway.
Now, issue the same again from PC1:
PC>ping 20.20.20.25
Pinging 20.20.20.25 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 20.20.20.25:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
PC>
The ping still fails. Why?
Answer: Besides PC1 now has a default gateway, Server2 still doesn’t not have it.
Set the default gateway to be used by Server2.
Remember: A default gateway is the device used by the local network devices to reach networks out of the local network scope.
What is the IP address to be used as a default gateway on Server2?
Answer: 20.20.20.1 which is the IP address of Router1’s interface connected to the same network which Server2 is connected.
After you have the correct default Gateway configured on Server2, issue the ping command from PC1 again:
PC>ping 20.20.20.25
Pinging 20.20.20.25 with 32 bytes of data:
Reply from 20.20.20.25: bytes=32 time=122ms TTL=120
Reply from 20.20.20.25: bytes=32 time=180ms TTL=120
Reply from 20.20.20.25: bytes=32 time=175ms TTL=120
Reply from 20.20.20.25: bytes=32 time=164ms TTL=120
Ping statistics for 20.20.20.25:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 122ms, Maximum = 180ms, Average = 160ms
PC>
The ping is now successful.
Once you have established the lower layers and routing connectivity, access the web page stored at Serve2 via HTTP protocol by opening a web browser at PC1 and typing Server2 IP Address on it.
The web page stored on Server2 is now shown.
Task 3: The ARP Table When Sending Packets to Remote Metworks
Check PC1’s ARP Table again:
PC>arp -a
Internet Address Physical Address Type
10.10.10.1 0005.5e4e.8a38 dynamic
10.10.10.13 000d.bd62.d826 dynamic
PC>
The ping to Server2 was successful but why the entry for Server2 (20.20.20.25) is not listed on the ARP Table? What is the address listed on the PC1’s ARP Table?
Answer: Since Server2 lies in a remote network, the ARP protocol running on PC1 queries for the gateway’s MAC Address. Router1 is default gateway configured on PC1 and its IP Address (10.10.10.1) shows up on the PC1’s ARP Table.

Tools For Visual Basic

Build powerful line-of-business applications
Tap the development foundation of Tools for Visual Basic and Microsoft Visual Basic Add-Ins to automate the creation of Visual Basic controls and assist in the development process. Microsoft ActiveX® controls and properties are fully integrated with the Visual Basic Integrated Development Environment (IDE). Access the power of SQL Server
Minimize the effort required to create Microsoft SQL Server-based applications. Microsoft SQL Server database APIs can be accessed by using Tools for Visual Basic components to provide forward and backward record navigation, field validation, field value lookup, common event logging, multi-user contention, automated transaction rollback, and more. Reduce development time
Easily maintain SQL table data, generate new SQL tables, place Visual Basic controls on Visual Basic forms with application properties already set, and add new reports from Crystal Reports 10.0. In addition to programming components, Tools for Visual Basic provides design dictionary utilities to support the development process. Manage customizations
Allow users of your applications to perform customizations and extensions to your applications — without changing your source code. Applications created using Tools for Visual Basic are enabled for Microsoft Dynamics SL Customization Manager. Realize quick return on investment with MSDN
Achieve maximum return on your investment by mastering Tools for Visual Basic quickly with hands-on training that teaches the Visual Basic development environment used by Microsoft programmers. Also, the MSDN Library contains technical programming information including sample code, documentation, technical articles, and reference guides for Tools for Visual Basic and other Microsoft development environments.
 

Home | Blogging Tips | Blogspot HTML | Make Money | Payment | PTC Review

jump 4 life © Template Design by Herro | Publisher : Templatemu