Date: Thursday, March 6th, 2003 5:31 p.m. on Wes Montgomery's birthday From: Mark Jacobson To: 810-023-01@uni.edu Subject: Bridges, MAC addresses, routing tables, pipes, input/output redirect Hi 023 students, Here are the Fall 2002 quiz questions I showed you in class on Tuesday, plus one additional one you did not see: 1. What command would be used to show all of the associations that have any occurrence of the two letters "XL" in them? 2. What command could be used to show just the count of the number of associations on your computer? 3. What does a bridge do with a packet whose destination address and whose source address both do not exist in the bridge's routing table? a. Describe everything that happens to the packet? b. Describe how the bridge will be different afterwards. 4. Suppose that I want to have a file containing a list of all my computers associations. I want to name the file MyAssoctions.TXT and have it saved on my Z: drive, where I am currently working. What command would I give at the Z: prompt to create this file named MyAssociations.TXT? 5. Suppose that I type the command DIR and the directory listing is much too large to view on one screen. I need to see all of it, including the details. What command should I use to see the same listing, but slowed down to only show me one screenful at a time. --------------------------------------------------------------------------- C:\>help find Searches for a text string in a file or files. FIND [/V] [/C] [/N] [/I] "string" [[drive:][path]filename[ ...]] /V Displays all lines NOT containing the specified string. /C Displays only the count of lines containing the string. /N Displays line numbers with the displayed lines. /I Ignores the case of characters when searching for the string. "string" Specifies the text string to find. [drive:][path]filename Specifies a file or files to search. If a path is not specified, FIND searches the text typed at the prompt or piped from another command. C:\>help assoc Displays or modifies file extension associations ASSOC [.ext[=[fileType]]] .ext Specifies the file extension to associate the file type with fileType Specifies the file type to associate with the file extension Type ASSOC without parameters to display the current file associations. If ASSOC is invoked with just a file extension, it displays the current file association for that file extension. Specify nothing for the file type and the command will delete the association for the file extension. ------------------------------------------------------------------------- Comments: We have used assoc and find in at least three different classes or labs this semester. You use DIR > myDirectory.txt to create a file my redirecting the output of the DIR command to a file named myDirectory.txt You use DIR | MORE to redirect output through a pipe so that the output of the DIR command goes into the pipe, and what flows out the other end of the pipe will flow into the MORE command, which displays text one page or screenful at at time. You would CommandName < inputFileNameForTheCommand and the < input redirection operator to get the input to flow into the command from a file instead of from the keyboard. bc < bc.data on cowboy would show this output, if the bc.data file had these 6 lines: bc.data ----------- 4 2*2*2*2 Note: 2^4 means 2 2^4 2^20 1024*1024 3 2^30 1024 cubed = 1024 = 1024^3 1024^3 venkman@jet:~$ bc < bc.data 16 16 1048576 1048576 <------ 1M or 1Meg, about 1 million 1073741824 1073741824 <------ 1G or 1Gig, about 1 billion venkman@jet:~$ 1,048,576 is close to 1 million but 1,024 squared is bigger than 1,000 squared. 1,073,741,824 is around 1 billion, but 2 to the 10th, or 1,024 when you cube it, is for sure larger than 1,000 cubed. Here is what bc program on cowboy.cns.uni.edu looks like when you do NOT redirect the input using < like venkman@jet:~$ bc < bc.data venkman@jet:~$ bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 2003+10 2013 2^10 1024 obase=2 <------ output base (obase) will be base 2, binary 255-31 11100000 255-15 11110000 obase=10 <------ output base (obase=10) will be decimal again. 255-31 224 255-15 240 venkman@jet:~$ And one more, a good review of the subnet mask concept, which will for sure be covered again on quiz two, as it is a comprehensive quiz. You will be Hamming it up again, ha ha! ------- venkman@jet:~$ bc ibase=2 <----------- ibase=2 means input base will be binary so all input is in base 2. 11111110 254 11111100 252 11111000 <------------- 5 1's followed by 3 0's is a legal 248 octet value for subnet masks, right? 11110000 240 ----- 11100000 <-------------- February 24th = 224 = 11100000 224 --- 11000000 192 10000000 128 11111111 255 venkman@jet:~$ Finally, the routing table for a bridge, we covered in class on Wednesday during the review section. 3. What does a bridge do with a packet whose destination address and whose source address both do not exist in the bridge's routing table? a. Describe everything that happens to the packet? Hard to do here without drawing a diagram. I will try. Computers A1 to A88 # # B R I D G E # R G =====port A====I D==== port C======Computers C1 to C125 D I G R E G D I R B # # port B # #============= computers B1 to B50 Suppose the packet is from computer A1 and it to computer B8. The packet comes in on port A to the bridge. The bridge looks in its routing table and does not see the address B8, so the bridge sends it out both port B and port C. It send it out all of the ports, except the incoming port. Obviously, the port it came in on does not need to have the packet on its ethernet cable again, as all those computers got to "see" the packet as it went by. But both the subnetwork areas B and C will have to deal with the traffic of this packet on their information highways (or side streets, it is just part of a LAN, after all, and not out on the Internet with its Information Superhighways). So the packet "crosses" the bridge and is now "traffic" on the B and the C wires. In summary, the packet came in on port A (which has its own network interface card (NIC) or network adapter card (NAC). Each port has its own Network Interface Card or MAC address. And the packet went out or was sent out both port B and port C. We can say one last thing that happened to the packet. Its source address was added to the routing table for the bridge, so now the bridge "knows" that anything destined for the computer with MAC address A1 is going to be sent out port A, if it was received at port B or port C, and is going to be discarded or stopped and NOT let across the bridge, if it comes in to the bridge from port A. The bridge is learning, right? Hopefully, you are too! :-) b. Describe how the bridge will be different afterwards. The bridge will have a new entry in its routing table. Mac address Port to get to it ----------- ----------------- A1 A Now, in the Wednesday class we carried this a couple more steps. Suppose next packet is from source A5 to destination A1. Two things happen at the bridge: It receives the packet, examines the destination and sees that the destination is out on the subnetwork of the port where the packet came in, so it will NOT let it cross the bridge and add to the traffic over on either the B or C subnets. It examines the source (return address of sender) and sees that A5's MAC address is not in the routing table. It adds A5 48 bit, 6 byte MAC address to the table. The routing table now looks like this: Mac address Port to get to it ----------- ----------------- A1 A A5 A Now, suppose a packet comes in from C44 to port C and it is destined for A1. What happens? 1. The bridge sees that A1 destination is on a different port that port C, so puts the packet across the bridge. Out you go, little packet, on your way, on the wires coming out of port A. The bridge does NOT put the packet out port B. Just sends it out port A. 2. The bridge sees the origin or source address was C44 and looks in its table and does not find the MAC address C44. So it adds the C44 NIC address and it's now known port to the routing table, which will make it look like this. Mac address Port to get to it ----------- ----------------- A1 A A5 A C44 C Before long, the routing table will be huge and the bridge will now where everything is. If the network breakdown has been well planned and the communications are typical (say A is the Marketing group area, B is Personnel/Management, and C is Sales/Accounting/Payroll/Customer Services, for example), then 80% or so of the packets that are sent out by computers on the A subnetwork area (Marketing) will have destinations on A, so the majority of that traffic will not tie up the LAN information side streets and two lane highways and gravel roads of subnetwork B or C. The network groups will be kept from being flooded by traffic that is now relevant or destined for computers or servers or printers in their group. Truly, a bridge over troubled H O molecules. 2 B R I D G E R G I D D I G R E G D I R B ~~~~~~~~~~~~~~~~~~~~~~~~~~~ <---- Troubled Waters (Sorry, could not resist! Simon and Garfunkle would strongly approve of this bridge, however). Mark