• No results found

CAP Graphical User Interface (CAPgui)

4.3 Operating System FreeBSD

4.4.2 CAP Graphical User Interface (CAPgui)

A PHP [109] based web front-end is provided for initial and subsequent congurations of the CAP and it has been named CAPgui. The CAPgui also provides the user with connectivity and system health variables to monitor the status of upstream links and the CAP.

The CAPgui is hosted on the CAP using the Lighttpd [53] web server. Lighttpd was chosen over other web server implementations as it is designed and optimised for any server (or PC) that is either already under heavy load or has limited memory or processing ability [53]. As the CAPs are deployed to low cost or low performance machines, using an application which is ecient and has a small memory footprint is advantageous.

The CAPgui is required to display dynamic content as the content is dependent on monitoring information and conguration pages. As the content is not static the pages are generated by server-side PHP running on the CAP. The PHP generates Extensible HyperText Markup Language (XHTML) [113] pages for the Internet Browser to display. XHTML is an application of Extensible Markup Language (XML) [42], which requires the document to be well-formed and able to be parsed by a standard XML parser. Cascading Style Sheets (CSS) [114] have been used to separate the presentation of the page from the information contained in the XHTML. Conguration changes within the CAPgui modify a single XML le. The XML le is parsed, when the CAP is rebooted via the CAPgui, to generate and update FreeBSD conguration les for various system settings and service conguration. More detail about how these conguration les were generated is described in Appendix B.1. The CAPgui User Manual, source code, background scripts and screenshots of all the pages can be viewed in Appendix C.

Figure 4.3 demonstrates the CAPgui which is the front-end for the CAP. This particu- lar CAP is deployed in the Settler City Wireless (SCW) testbed network. Figure 4.3 shows the rst page seen when visiting the CAPgui, the System Status page. In the top left of the gure, a logo displaying CAPgui informs the user where they are. The top-right of the CAPgui provides the hostname of the CAP, in this example benm.scw.ru.ac.za. The menu (on the left-hand side of the page) is separated according to content that can be viewed (Status), conguration modication (Conguration) and external links to the Access Concentrator. Items listed beneath Conguration are only visible to the user once they have been authenticated, if they are not authenticated, the only item in this list is

4.4. Community Access Point (CAP) 68

Figure 4.3: CAPgui - System Page

Log In. The central area of the CAPgui interface displays the content that is relevant to the specic page that the user is currently viewing. Lastly, the bottom of the page provides a footer to denote the bottom of the page.

The items under Status are System, Services, Disk Usage and Interfaces. These pages display system health variables for the CAP. The various Status pages display information from log les which are generated by PHP scripts that run at ve minute intervals (unless otherwise specied) on the CAP. By separating the gathering of status information from displaying it, the Status pages have improved loading times as they do not have to wait for information to be gathered.

The System Status page, seen in Figure 4.3, provides upstream `Connectivity' status, displaying information about the status of upstream links. If any items within this list are down they are highlighted in the colour red, otherwise if they are up they are highlighted in the colour green. The connectivity table relies on a background bash [35] script which checks the status of the PPP process and uses ping [67] to test upstream network hosts every ve minutes.

Also in the System Status page, `System Information' is displayed showing `System Uptime', `Current CPU Usage', `Current Memory Usage' and `Swap Usage'. These vari- ables, specically CPU and memory usage, are constantly changing and are obtained every time the page is visited or refreshed. The `System Information' is obtained by using PHP scripts which execute specic commands on the AC to obtain the necessary information. The System Status page is the rst point of reference for administrators wishing to troubleshoot network issues or check the status of the CAP. If any of the `Connectivity'

4.4. Community Access Point (CAP) 69

Figure 4.4: CAPgui - Service Status Page

Figure 4.5: CAPgui - Disk Usage Status Page

items are down, administrators can take the necessary steps to rectify the root cause of the problem. A owchart was produced for administrators (or network support sta) to follow in the case of no or limited access to the Internet from their C-LAN, see Appendix C.

The Services Status page, highlights various important network services, such as PPP, SSHd, Softowd, SNMPd and DHCPd in a table. Figure 4.4 displays such a table. In this example, all the services are up (and highlighted in the colour green) except for DHCPd which is down (highlighted in the colour red). The service status information is gathered by using the SNMP service on the CAP (see Appendix A.1 for details of the MIBs requested). However, if SNMP is unavailable then the services are checked by using a PHP method which executes ps (process status) [31] on the CAP. In this case, SNMPd would be marked as down.

The Disk Usage Status page provides a table with the FreeBSD mount points and per disk partition the total size, the amount used, amount available and percentage used are displayed. An example can be seen in Figure 4.5. In this example, the total disk size was 8 GB. The Disk Usage Status page allows administrators to resolve issues such as running out of disk space on the CAP. The table relies on a PHP method which executes df [30] on the CAP to provide details about each partition and their related usage status.

The last of the Status pages, the Interfaces page, provides a table of the network interfaces with various elds relating to their conguration and monitored statistics. In Figure 4.6, three network interfaces are present: `int0', the internal interface; `ext0', the external interface; and `tun0', the PPPoE tunnel interface to the AC. The interface table provides information for each one's status (UP or DOWN ), IP Address, Netmask, MAC

4.4. Community Access Point (CAP) 70

Figure 4.6: CAPgui - Interfaces Status Page

f u n c t i o n is_hostname ( $hostname ) {

i f ( ! is_string ( $hostname ) ) return f a l s e ;

i f (preg_match( " /^([_a−z0 −9\−]+\.?)+$/ i " , $hostname ) ) return true ;

else

return f a l s e ; }

Figure 4.7: Perl Regular Expression in PHP to Check a Valid Hostname

Address, Media Type, Bytes In and Bytes Out. An administrator can visit this page to view the network conguration of the CAP, see what type of network the interfaces are connected to (Media) and view the number of bytes transferred in and out of the network interfaces. The interfaces table obtains its data using SNMP on the CAP (see Appendix A.1 for details of the MIBs requested).

Following the Status pages are the Conguration pages. The Conguration pages allow the modication of system and service settings, and therefore are only available to a user who has been authenticated. As the pages rely on input by the user to update conguration, all input is validated for the specic eld that is being updated. Input is validated using a variety of methods, but the majority of the methods rely on custom Perl Regular Expressions [32] in PHP. For an example of such a Perl Regular Expression, namely one checking whether a hostname is correct, see Figure 4.7. By validating the input, checks can be put in place to make sure the CAP is not miscongured. If the input fails the validation check, the user is presented with a description of what type of input is expected and the XML conguration is not updated. When the input has been validated, the user is shown a list of changes, the XML conguration le is updated with the new settings and new conguration les relevant to that page are generated from the XML.

Conguration pages are available for General, Network, PPPoE, Static Routes, SN- MPd, Softowd and DHCPd. The View Cong Files page allows the administrator to view the conguration les that have been generated or updated by the CAPgui. Additionally, the Reboot CAP page allows the CAP to be rebooted to load the new conguration les.

4.5. Access Concentrator (AC) 71

Figure 4.8: CAPgui - DHCPd Conguration

For an added level of security the user has to conrm their username and password to reboot the CAP.

In Figure 4.8, the Conguration page for DHCPd is presented. It displays the common layout of all Conguration pages, with elds for the relevant conguration in a table layout and a `Save' button at the bottom right.

Under the Access Concentrator heading, there are links to the ACgui, Cacti and LightSquid. Visiting the ACgui provides more detailed information about the status of the C-WAN, including the statuses of all the CAPs within the network. Cacti is a graphing application which displays graphs for all devices in the C-WAN, LightSquid provides detailed reports on all Internet access by the C-WAN via the Squid proxy.

The CAPs connect via PPPoE tunnels to the AC which provides the C-LANs with connectivity to the rest of the C-WAN or the Internet. The AC is discussed in detail in the next section.

4.5 Access Concentrator (AC)

This section discusses the implementation of the AC. First, an overview of the AC is presented in Section 4.5.1 describing the various parts of the implementation. Section

4.5. Access Concentrator (AC) 72

Figure 4.9: Access Concentrator Implementation

4.5.2 discusses the networking and routing related conguration. In Section 4.5.3 the applications hosted on the AC are detailed. Section 4.5.4 discusses the methods utilised for managing bandwidth by imposing Internet usage quotas in the C-WAN. Lastly, Section 4.5.5 presents the PHP web based front-end of the AC, the ACgui, and how it was implemented.