Friday, April 8, 2016

Hub vs Switch vs router vs VLAN

a hub, a frame is passed along or "broadcast" to every one of its ports. It doesn't matter that the frame is only destined for one port. The hub has no way of distinguishing which port a frame should be sent to. Passing it along to every port ensures that it will reach its intended destination. This places a lot of traffic on the network and can lead to poor network response times. (layer 2)

A switch, however, keeps a record of the MAC addresses of all the devices connected to it. With this information, a switch can identify which system is sitting on which port. So when a frame is received, it knows exactly which port to send it to, without significantly increasing network response times. And, unlike a hub, a 10/100Mbps switch will allocate a full 10/100Mbps to each of its ports. So regardless of the number of PCs transmitting, users will always have access to the maximum amount of bandwidth. (layer 2)

A router is typically connected to at least two networks, commonly two Local Area Networks (LANs) or Wide Area Networks (WAN) or a LAN and its ISP's network . for example, your PC or workgroup and EarthLink. Routers are located at gateways, the places where two or more networks connect. Using headers and forwarding tables, routers determine the best path for forwarding the packets. Router use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.

Virtual LANs (VLANs) are an abstraction to permit a single physical network to emulate the functionality of multiple parallel physical networks. This is handy because there may be situations where you need the functionality of multiple parallel physical networks but you'd rather not spend the money on buying parallel hardware. (VLAN protocol 802.1Q) http://serverfault.com/questions/188350/how-do-vlans-work 46down voteaccepted If you have more than one VLAN on a port (a "trunk port"), you need some way to tell which packet belongs to which VLAN on the other end. To do this you are "tagging" a packet with a VLAN tag (or VLAN header if you like). In reality a VLAN tag is inserted in the Ethernet frame like this: VLAN Header

The 802.1Q (dot1q, VLAN) tag contains a VLAN-ID and other things explained in the 802.1Q Standard. The first 16 bits contain the "Tag Protocol Identifier" (TPID) which is 8100. This also doubles as the EtherType 0x8100 for devices that don't understand VLANs. So a "tagged" packet contains the VLAN information in the Ethernet frame while an "untagged" packet doesn't. A typical use case would be if you have one port from a router to a switch which multiple customers are attached to: VLAN Trunking

In this example customer "Green" has VLAN 10 and Customer "Blue" has VLAN 20. The ports between switch and customers are "untagged" meaning for the customer the arriving packet is just a normal Ethernet packet. The port between router and switch is configured as a trunk port so that both router and switch know which packet belongs to which customer VLAN. On that port the Ethernet frames are tagged with the 802.1Q tag.

Thursday, March 3, 2016

create UEFI shell on USB flash drive

Boot Process under UEFI

  1. System switched on. The Power On Self Test (POST) is executed.
  2. UEFI firmware is loaded. Firmware initializes the hardware required for booting.
  3. Firmware reads the boot entries in the firmware's boot manager to determine which UEFI application to be launched and from where (i.e. from which disk and partition).
  4. Firmware launches the UEFI application.
    • This could be the Arch kernel itself (since EFISTUB is enabled by default).
    • It could be some other application such as a shell or a graphical boot manager.
    • Or the boot entry could simply be a disk. In this case the firmware looks for an EFI system partition on that disk and tries to run the fallback UEFI application \EFI\BOOT\BOOTX64.EFI (BOOTIA32.EFI on 32-bit systems). This is how UEFI bootable thumb drives work.
If Secure Boot is enabled, the boot process will verify authenticity of the EFI binary by signature.
 

Create UEFI shell on USB flash drive


  1. Format your USB stick with FAT32
  2. Create this folder structure on the stick: "EFI\BOOT"
  3. Download Intel's Tianocore UEFI Shell 1.0 and rename the file to "BOOTX64.EFI"
  4. Copy "BOOTX64.EFI" to "EFI\BOOT" on your stick
  5. Goto BIOS, change to UEFI boot
  6. Plugin in your USB stick, boot and hit F10 to enter the boot menu.
  7. Press enter the shell will start. When loaded type "fs0:" to switch to the USB stick file system:
  8. Do whatever you like 

Tuesday, February 2, 2016



Thinking in Java problem on Eclipse when importing source files


import java.util.*;
import static net.mindview.util.print.*;
public class HelloWorld {

   
    public static void main(String[] args) {
        System.out.println("hello world");
        Print("this does not work");
    }



in the editor on the x next to the import statement the error is:
The import net cannot be resolved 

in the editor when I put my mouse on the x next to the print statement it reads:
The method Print(String) is undefined for the type HelloWorld 


when I try to run it in eclipse this is the error I get:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
The method Print(String) is undefined for the type HelloWorld 
at HelloWorld.main(HelloWorld.java:8)
 

Solution:

So we move to directory structure: 

BTW - I assume you're running javac and java commands from the command line, since you didn't suggest otherwise in earlier posts. If that's wrong, describe your environment and compile/run process. 

In my environment, I have the directory structure: 


main
  |- net
  |    |- mindview
  |            |------util
  |                     |
HelloWorld.java         |
                        |
                       Print.java

You have to create a new source folder under the existing folder named 'src'. 
In the project explorer right click the folder 'scr' then New then Source folder, name it 'net.mindview.util' 
then right click the new folder 'net.mindview.util' 
then click new then click package and name it 'net.mindview.util' 
then right click on the package named 'net.mindview.util' and select import then select File System in the list 
then click next then navigate to the folder 'net.mindview.util' on your hard drive, 
there will be two boxes in the import window 
the left side will have a folder named 'util' with a check box, if you check this all of the .java files from the 'net.mindview.util' will be imported into your project and everythinng will work. 
The box on the right side is all the induvidual .java files and you can pick and choose what files you want to import... 

original source:

http://www.coderanch.com/t/566491/java/java/Thinking-Java

main page: