Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Basic System Architecture by Hoang Lihuo

    System architecture is the conceptual model that defines the structure, behavior, and more views of a system. An architecture description is a formal description and representation of a system, organized in a way that supports reasoning about the structures and behaviors of the system.

System architecture can consist of system components and the sub-systems developed, that will work together to implement the overall system. There have been efforts to formalize languages to describe system architecture, collectively these are called Architecture description languages (ADLs).

    Devices, such as computers, servers, printers, etc., that connect to a local area network (LAN) are normally called stations or terminals . We use both in this course. A wireless access point (AP) is a device connected to a LAN to allow wireless stations to become part of the LAN. It is a transceiver. In a simple case, the AP may only serve one station. Normally, the AP will serve more than one station. In addition, there may be more than one AP connected to a LAN. This provides additional capacity and can serve to cover a large geographic area by placing.

    APs covering the area. APs can stand alone and serve to connect only wireless devices to each other. Normally, however, they are used in conjunction with a wired LAN. A primary use is connection to the public Internet or to a large corporate enterprise network and somewhere these networks get back to wires.

    The range of operations is measured from the AP. For example, the range of 802.11b for 11 Mb/s is about 100 feet. This distance is measured from the AP in all directions and is actually a sphere although most people only think of it as a horizontal circle around the AP. But the AP is a radio transmitter (and receiver) and the transmissions radiate in all directions from the antenna. If the AP is located on the fifth floor of a building, it will radiate around the fifth floor but also radiate up to the sixth and seventh floors as well as down to the fourth and third floors. The penetration of the radio waves through the floors may not be as great as through the walls and the sphere of radiation may be somewhat “squashed” but some radiation up and down will occur. Since most wireless applications connect to a wired LAN or to some other network like the Internet, APs also come integrated into other LAN devices such as bridges or routers.

    Multiple access points covering a geographic area such as a campus or large office complex allow roaming across the area. User stations such as laptop computers with wireless network interface cards (NIC) will communicate with the “nearest” AP. Nearest really means the AP with the greatest signal strength at the point where the user is located, which might not physically be the nearest AP. APs form a LAN segment. Wireless stations vie for use of the wireless media in the same way wired stations vie for use of the wired media. The method specified in 802.11b is called carrier sense multiple access with collision avoidance or CSMA/CA. It is a method similar to CSMA/CD first specified in IEEE 802.3, the 
bus standard for wired LANs. 

How to Use Cellular as Backup Internet Access When Your DSL, Cable or Fiber Internet Dies. by Hoang Lihuo


    The Internet connection at your office dies. Lights on your modem are flashing in a strange pattern. You call the ISP, and they quickly diagnose that the modem power supply has failed, and they will overnight you a replacement. Presumably you are not the first person to have this problem with that modem. 
    So how do you continue to operate while you are waiting for the replacement power supply? It's hard to run your business without e-mail and ordering and administration systems, which are all accessed via the Internet.
     A large business will be a station on a Metropolitan Area Network, which is a ring, meaning two connections to the Internet for that business and automatic reconfiguration in the case of one failing. But this is expensive... the second connection is not free. 
    Small and medium businesses usually have a single DSL or cable modem connection to the Internet. When that fails, connectivity to email, ordering and administration servers is impossible, and many businesses these days would be "dead in the water" until the ISP fixes the problem with their hardware. 
Unless you have an Android smartphone, a good "data" plan and a laptop with WiFi running Windows. 
    The scenario described happened at our office last week. Since many of our customers might find themselves in a similar situation - even at home - I thought I'd share the quick and painless solution I came up with. Even if you're not likely to need this solution, understanding how it works will no doubt sharpen your understanding of the devices involved and their functions. 

    In this tutorial, I will use the technology in our office: 50 Mb/s DSL, Android smartphone and Windows laptop. The solution is equally applicable to an Internet connection using a cable modem or if you are one of the lucky few, an Internet connection via fiber. 

    For the smartphone and laptop, there may be equivalent functions on Apple products, but as I am allergic to Apples, we don't have any in the office.

    The diagram above illustrates the normal network setup in our office, a typical configuration for networking at a small or medium business. On the left is the access circuit to the Internet Service Provider (ISP), terminating on a modem in our office.

    The modem is contained in a box that also includes a computer and an Ethernet switch. This box is more properly called the Customer Edge (CE). The computer in the CE runs many different computer programs performing various functions: Stateful Packet Inspection firewall, DHCP server offering private IP addresses to the computers in-building, DHCP client obtaining a public IP address from the ISP, a Network Address Translation function between the two, routing, port forwarding and more.

    In-building is a collection of desktop computers, servers and network printers. These are connected with Category 5e LAN cables to Gigabit Ethernet LAN switches, one of which is also connected to the CE.

    When a desktop computer is restarted, its DHCP client obtains a private IP address and Domain Name Server (DNS) address from the DHCP server in the CE. The private address of the CE is configured as the "default gateway" for the desktop by Windows.

    When a desktop computer wants to communicate with a server over the Internet, it looks up the server's numeric IP address via the DNS, then creates a packet from the desktop to the Internet server and transmits it to its default gateway, the CE. The NAT function in the CE changes the addresses on the packet to be from the CE to the Internet server and forwards the packet to the ISP via the modem and access circuit. The response from the Internet server is relayed to the CE, where the NAT changes the destination address on the return packet to be the desktop's private address and relays it to the desktop.

    An Android smartphone and a laptop running Windows were used to restore connectivity to the Internet without making any changes to the desktops, servers or network printers.

First, I took my Samsung smartphone running Android out of my pocket and plugged in the charger. Then on its menu under Settings > more > Tethering & portable hotspot > Set up Wi-Fi hotspot, I entered a Network SSID ("TERACOM") and a password, clicked Save, then clicked Portable Wi-Fi hotspot to turn it on.

        The smartphone is now acting as a wireless LAN Access Point, just like any other WiFi AP at Starbucks, in the airport or in your home. At this point, the smartphone is the CE device, performing all of the same functions that the DSL CE device had been before it died: firewall, DHCP client to get a public IP address from the ISP (now via cellular), DHCP server to assign private IP addresses to any clients that wanted to connect (now via WiFi), NAT to translate between the two and router to forward packets.

    Just as the DSL CE equipment "bridged" or connected the DSL modem on the ISP side to the Ethernet LAN in-building, allowing all the devices on the LAN to send and receive packets to/from the Internet via DSL, the smartphone "bridges" or connects the cellular modem on the ISP side to the WiFi wireless Ethernet LAN in-building, allowing all the devices on the wireless LAN to send and receive packets to/from the Internet via cellular radio.

    The remaining problem was that none of the desktops or servers had wireless LAN cards in them, so they could not connect to the smartphone AP and hence the smartphone's cellular Internet connection. What was needed was a device to "bridge" or connect the wired LAN to the wireless LAN in-building.

    By definition, this device would need two LAN interfaces: a physical Ethernet jack to plug into the wired LAN, plus a wireless LAN capability. Looking around the office, I spotted two devices that fit this description.

    One of them was my laptop, with both a LAN jack and wireless LAN. I fired up the laptop, plugged it into an Ethernet switch with a LAN cable, and in the Network and Sharing Center, clicked Change Adapter Settings to get to the Network Connections screen that showed the two LAN interfaces.

    I enabled both the wired and wireless LAN interfaces. Then right-clicking the Wireless Network Connection icon, selected the TERACOM wireless network and entered the password.

    Once that was successfully connected, I selected the two adapters in the Network Connections screen, right-clicked and chose "Bridge Connections". A message saying "Please wait while Windows bridges the connections" appeared, then an icon called "Network Bridge" appeared, and after a few seconds, "TERACOM" appeared as well.

    My laptop was now acting as an Ethernet switch, connecting the wired LAN to the smartphone's wireless LAN.

    Each of the desktops, servers and network printers in the office had to be rebooted so they would run their DHCP client again, obtaining a private IP address and DNS address from the smartphone AP, and be configured so the smartphone was the "default gateway" in Windows.

After rebooting my desktop computer, it had Internet access over the wired LAN, through the wired Ethernet switch to my laptop, to the smartphone via WiFi then to the ISP over cellular. After rebooting the other desktops and servers, all had Internet access again, with no changes to the configuration of the desktops or servers.

    This took about 20 minutes to get up and running, and we were back in business.

Running a bandwidth test on speedtest.net, I found we had exactly 10 Mb/s connection to the Internet via cellular. Obviously my cellular service provider limited the connection to 10 Mb/s in software - but who's complaining? 10 Mb/s is seven times as fast as a T1, which cost $20,000 per month when I first started in this business 20 years ago.

    I hope you found this tutorial useful, either as a template for your own emergency backup Internet connection, or simply as a way of better understanding the devices, their functions and relationships.

The OSI 7-Layer Reference Model by Hoang Lihuo


    The Open Standards Interconnection model (OSI) is a network architecture reference model developed by the International Organization for Standardization in the 1980s. It is a conceptual model rather than a real-life implementation designed as a reference for developing network architectures and protocols.

    Having a standardised, multi-layer model has a number of benefits:

        +        Modularisation and abstraction – different components can handle different layers of the stack.             If you’re a web developer, you just need to worry about the application layer, not the full stack. 

 +      Standard interfaces – interaction between layers is well defined so that you can design your   product to run on top of a lower layer protocol regardless of who developed that.

 +         Interoperability – protocols at each layer are specified such that different vendor equipment       should be able to talk to each other at the same layer.

The OSI Reference Model is referred to as a 7-layer model because the total set of functions required to interwork diverse systems was defined and then broken up into seven groups or layers, and arranged in a hierarchy. Each layer has a name and a number. We start numbering at the bottom:

        1: Physical Layer The physical layer provides a raw bit stream service. It moves 1s and 0s between the systems. This is all it does, but it has to do this completely. The physical layer includes the mechanical, electrical, functional and procedural specifications for moving binary digits over a physical medium. 

        2: Data Link Layer The data link layer manages communications on a single circuit, a single link . There may be several stations connected to the circuit – a multidrop circuit – but it is a single physical circuit. Typically sends frames or cells of data across the physical medium with an error check, and performs flow control on the link. This allows communications of blocks of data to another computer on the same circuit. 

        3: Network Layer What happens if we don't have a single link, but 86 of them, and we do not want our data broadcast to all 86 destinations, but rather want it routed and delivered to just one destination? This is the definition of a network… moving data from one link to another, essentially a forwarding function.
     
     4: Transport Layer If the receiver isn't on our network, but on another one, and the networks are connected together with data circuits, or worse yet, multiple intervening networks, how do we know that our data got delivered? The transport layer provides end-to-end error checking to verify that the data was successfully delivered to the far end, and in some cases, retransmit data that was not. Also specified in the transport layer header is the source and destination port number; essentially an identification of which computer program to communicate with on the far-end computer.
      
        5: Session Layer The session layer manages sessions between applications, including initiation, maintenance and termination of information transfer sessions. Usually this is visible to the user by having to log on with a password. SIP is another example of a session layer protocol, used to set up Voice over IP phone call sessions.

         6: Presentation Layer The presentation layer is very important: this is the coding step. How are we going to represent our message in 1s and 0s? ASCII is an example of a presentation layer protocol. Compression and encryption can also be discussed here – they too are methods of coding messages into 1s and 0s.

         7: Application Layer Sitting on top of all of this is the application layer. The application layer defines the format of the messages that will be exchanged, and is usually bundled with a Human-Machine Interface - the applications you and I use to get access to all of this wonderful distributed computing and communications.