Systems and Network Management

Revision Exercises with Perl, routing, switching and LDAP

1 Perl

1. Write a regular expression to match two or more “x”s followed by one or more “y”s followed by any number of “z”s.

2. Write a regular expression to match any number of backslashes “\” followed by any number of asterisks “*”. Note that “any number” might be zero.

MSRP6604R1    Student Progression Rank Details                Page 1 of 4
Academic Year : 2002/03          Course Board Control No.          APS1238
Progression Course : 95551/2    in HW
                          95570/2    in LW
                          95573/2    in LW
                          95731/2    in LW
Code        Student No.    Name                 Attained  Loc Course/YearClass
95551/2     987654321      WAN Siu Ming (970)       41.0   TY      41230/1G
95551/2     976543210      FUNG Siu Ming (618)      42.1   TY      41456/2B
95551/2     965432109      YUET Siu Ming (639)      43.2   TY      41789/3B
95551/2     954321098      WONG Siu Ming, Joe (571) 44.3   TY      41012/1G
95551/2     943210987      KLIE Siu Ming (486)      45.4   TY      41345/2G
95551/2     932109876      WANG Siu Hing (370)      46.5   TY      41678/3G
95551/2     921098765      WONG Siu Ming (436)      47.6   TY      41901/1G
95551/2     910987654      FONG Siu Ming (359)             TY      41234/3G
95570/2     909876543      HO Siu Ming (133)        49.8   TY      41567/2B

Figure 1: A text file containing data

3. Figure 1 shows a text file containing data. Write a Perl program to print all student numbers.

4. Write a perl program to print the course, year and class, each in a separate column, separated by a tab character.

5. Write a perl program to generate a password for each student according to the following algorithm:

• Take the student’s name (but without the number in brackets);

• Remove all spaces and non-alphabetical characters from the name;

Revision Exercises with Perl, routing, switching and LDAP Systems and Network Management

2

• Use the first eight characters left, append them to the last four digits of the student number.

Your program should print:

• the student number;

• the full name of the student;

• the student’s generated password

all separated by a single tab character. There should be one line of output per student.

2 Routing and Switching

1. Before a set of candidate network routes can be aggregated, they must be in the , and the routes in binary format must have the .

Figure 2: A network with five routers and ten subnets.

2. Figure 2 shows a network with 5 routers and 10 subnets. You may select ip addresses from the block of addresses 172.12.0.0/19. You must leave at least one quarter of these addresses available for other purposes. The requirements are that each of subnets 1, 2,…, 8 must support up to 130 computers, while subnets 9 and 10 must each support up to 600 computers.

(a) Allocate a suitable block of addresses to each of the ten subnets that will allow maximum route aggregation.

(b) Given your selection in the previous part, with no route summarisation active on the routers, list the routes that would be advertised by router A at X, by router B at W, by router C at V, by router D at Y, and by router E at Z.

(c) What would be a necessary requirement for the routers to support route aggregation?

(d) Repeat part 2b, but for the case where the routers all support route summarisation.

3. When using portable notebook computers that should remain on one subnet, what type of vlan should be employed? Are there any difficulties in supporting such a vlan arrangement?

Revision Exercises with Perl, routing, switching and LDAP Systems and Network Management

3

Figure 3: Two switches, each with five ports.

4. Two switches each have five ports, as shown in figure 3. Both switches are to support three vlans, vlan1, vlan2 and vlan3. Computers will be connected to each of these three vlans on each of the two switches.

(a) Each vlan is to support a separate subnet. How would you connect the switches so that computers on each vlan can communicate with each other? Support your answer with a diagram showing the connection of the switches. Label the vlans. Indicate whether each port is a trunk port or an access port.

(b) One additional port is added to each switch. Now two users with portable computers, one belonging to vlan2 and the other belonging to vlan3 want to be able to plug into the newly added port on either switch and remain in their respective vlan without any manual configuration. How should you configure the new ports in each switch to facilitate this?

3 Directories and LDAP

Many of you have not completed the tutorial sheet “ldap Filters and Searching ldap directories.” I suggest that you complete it.