Skip navigation links
A B C D E F G H I L M P R S T 

A

actionPerformed(ActionEvent) - Method in class BitDisplay
 
actionPerformed(ActionEvent) - Method in class L3Display
Called when the user hits enter in the GUI field, indicating that a L3 Packet should be created and sent.
actionPerformed(ActionEvent) - Method in class Layer2Display
Called when the user hits enter in the GUI field, indicating that a Layer2 Frame should be created and sent.
actionPerformed(ActionEvent) - Method in class LightDisplay
 
addOrUpdateBySrcMac(int, SwitchPort) - Method in class Switch
used when checking if a source mac is recorded in the macAddr table.
addToOutQ(Layer2Frame) - Method in class SwitchPort
A caller (a Switch object) can to add a frame to the outgoing queue on this SwitchPort.
attachPort(SwitchPort, SwitchLightPanel) - Method in class Switch
Add the given SwitchPort/SwitchLightPanel to our collection of ports/panels.

B

BCAST_ADDRESS - Static variable in class Layer2Frame
 
BCAST_HOST - Static variable in class L3Address
 
BCAST_NET - Static variable in class L3Address
BCAST is defined to be an octet of all 1s, in each part of the address.
BitDisplay - Class in <Unnamed>
 
BitDisplay(BitHandler) - Constructor for class BitDisplay
 
BitHandler - Class in <Unnamed>
 
BitHandler() - Constructor for class BitHandler
 
BitHandler(String, int) - Constructor for class BitHandler
 
BitListener - Interface in <Unnamed>
 
bitsReceived(BitHandler, String) - Method in class BitDisplay
 
bitsReceived(BitHandler, String) - Method in interface BitListener
 
bitsReceived(BitHandler, String) - Method in class Layer2Handler
Called when the layer below receives bits successfully.
broadcast(String) - Method in class BitHandler
Given a string of bits (0s and 1s), send each bit using broadcastOne/Zero().
broadcastOne() - Method in class BitHandler
Turn the light system off (if it isn't already), then wait half a period.
broadcastZero() - Method in class BitHandler
Turn the light system on (if it isn't already), then wait half a period.

C

close() - Method in class LightPanel
 
CollisionException - Exception in <Unnamed>
 
CollisionException() - Constructor for exception CollisionException
 
computeParity(String, int) - Static method in class Layer2Frame
Compute the parity of the string of bits, by counting the number of 1 bits in the string and return the result as a 0-padded bit String of the given length.

D

DEFAULT_PORT - Static variable in class LightSystem
 
dropReceivedFrame(Layer2Frame, String) - Method in class Layer2Endpoint
drop received frames that do not have either a bcast destination mac address or this endpoint's destination mac address.
dropReceivedFrame(Layer2Frame, String) - Method in class Layer2Handler
A default implementation that says we do not drop a received frame.
dropReceivedPacket(L3Packet, String) - Method in class L3Handler
Drop any received packet that isn't for this interface.

E

enQueueOnAllPortsExceptOne(SwitchPort, Layer2Frame) - Method in class Switch
send the given frame on all registered ports, except port2Skip.
equals(L3Address) - Method in class L3Address
return true of this address is identical to the given one.

F

findEntryByMac(int) - Method in class Switch
return the entry for the given mac, or null if no entry exists.
frameReceived(Layer2Handler, Layer2Frame) - Method in class L3Shim
Called when a frame is received for this endpoint at layer 2.
frameReceived(Layer2Handler, Layer2Frame) - Method in class Layer2Display
Called when a frame is received in the handler from the layer below it.
frameReceived(Layer2Handler, Layer2Frame) - Method in interface Layer2Listener
 
frameReceived(Layer2Handler, Layer2Frame) - Method in class Switch
Handle frames received on a switch port.
fromDottedDecimal(String) - Method in class L3Address
Convert from dotted-decimal form.

G

getAddr() - Method in class L3Handler
 
getDestAddr() - Method in class L3Packet
 
getDestAddr() - Method in class Layer2Frame
 
getHopsLeft() - Method in class L3Packet
 
getHost() - Method in class L3Address
 
getID() - Method in class BitHandler
 
getID() - Method in class LightPanel
 
getL4Type() - Method in class L3Packet
 
getLength() - Method in class Layer2Frame
 
getMacAddr() - Method in class Layer2Endpoint
return the mac address of this endpoint.
getNetwork() - Method in class L3Address
getters
getNumPorts() - Method in class Switch
return numPorts value
getPanel(int) - Method in class Switch
return the ith switch port panel
getParity() - Method in class L3Packet
 
getParity() - Method in class Layer2Frame
 
getPayload() - Method in class L3Packet
 
getPayload() - Method in class Layer2Frame
 
getPortNum() - Method in class SwitchPort
 
getRandom() - Static method in class LightSystem
 
getSrcAddr() - Method in class L3Packet
 
getSrcAddr() - Method in class Layer2Frame
 
getVlanId() - Method in class Layer2Endpoint
return the vlanId of this endpoint.
getVlanId() - Method in class Layer2Frame
 

H

HALFPERIOD - Static variable in class BitHandler
 
HIGH - Static variable in class LightSystem
 

I

isBcast() - Method in class L3Address
return true if this address is the bcast address, 15.255.
isOn() - Method in class LightPanel
 
isOn() - Method in class SwitchLightPanel
 
isSilent() - Method in class BitHandler
 

L

L3Address - Class in <Unnamed>
An L3Address represents a L3 source or destination address, with its two parts: the network part and host part, each 1 octet long.
L3Address(int, int) - Constructor for class L3Address
Create an address from the net part and host part.
L3Address(String) - Constructor for class L3Address
Create an address from a 12-bit long string of 1s and 0s.
L3Display - Class in <Unnamed>
This class displays a GUI from which you can send and receive Layer 2 frames.
L3Display(L3Handler) - Constructor for class L3Display
Display 3 fields: a display field for putting status messages in and displaying the values in received packets; a DestAddr field, into which the user can type a destination address in the form x.y; a payload field into which the user types a bit string (0s and 1s).
L3Handler - Class in <Unnamed>
This class represents a L3 object that can send and receive L3 frames.
L3Handler(Layer2Endpoint, int) - Constructor for class L3Handler
Create a L3Handler, given a layer 2 endpoint, and the network part of the L3Address.
L3Listener - Interface in <Unnamed>
 
L3Packet - Class in <Unnamed>
This class represents a L3 packet, as defined in our class wiki.
L3Packet(L3Address, L3Address, int, String) - Constructor for class L3Packet
Create an L3Packet from field values.
L3Packet(String) - Constructor for class L3Packet
Create an L3Packet from a string of bits.
L3Shim - Class in <Unnamed>
This class strips off the L3type field that is required to be at the front of each Layer 3 packet, and demultiplexes based on it -- calling the object that has registered as handling the packets of that type.
L3Shim(Layer2Endpoint) - Constructor for class L3Shim
Create this object, storing the layer2 endpoint, and setting this object as a listener of frames from that layer 2 object.
L3ShimListener - Interface in <Unnamed>
 
L3TYPE_L3 - Static variable in class L3Shim
L3TYPE_L3 is the uniquely-assigned identifier for the L3 protocol -- the main protocol for forwarding packets across multiple networks through routers.
launchThreadToUpdateLights(int, SwitchLightPanel) - Method in class SwitchDisplay
Launch a thread that, every millisecond, checks the state of the "wire" on this port to see if it is "high" or "low".
Layer2Display - Class in <Unnamed>
This class displays a GUI from which you can send and receive Layer 2 frames.
Layer2Display(Layer2Endpoint) - Constructor for class Layer2Display
 
Layer2Endpoint - Class in <Unnamed>
A Layer2Endpoint represents a Layer 2 entity that has a MAC address hard-wired for it.
Layer2Endpoint(int) - Constructor for class Layer2Endpoint
Constructor: store the macAddr that identifies this endpoint, and use the super class to create a layer 2 object that we use to send/receive frames.
Layer2Endpoint(String, int, int) - Constructor for class Layer2Endpoint
Constructor: store the macAddr that identifies this endpoint, and use the super class to create a layer 2 object that we use to send/receive frames.
Layer2Frame - Class in <Unnamed>
This class represents a Layer2 Frame according to our protocol definition.
Layer2Frame(int, int, int, String) - Constructor for class Layer2Frame
Create a new Layer2Frame, given values for many fields, and deriving the values for the other fields.
Layer2Frame(String) - Constructor for class Layer2Frame
Given a string of bits which should be a legal Layer2Frame, parse it into its component pieces.
Layer2Handler - Class in <Unnamed>
This abstract class represents a Layer2 object that can send and receive layer 2 frames.
Layer2Handler() - Constructor for class Layer2Handler
Create an object, using "localhost" and DEFAULT_PORT, for the IP host and TCP port that this object's BitHandler will connect to (i.e., the LightSystem).
Layer2Handler(String, int) - Constructor for class Layer2Handler
Create an object, and create a BitHandler for it to use in the layer below it.
Layer2Listener - Interface in <Unnamed>
 
LightDisplay - Class in <Unnamed>
 
LightDisplay(LightPanel) - Constructor for class LightDisplay
 
LightPanel - Class in <Unnamed>
 
LightPanel(String) - Constructor for class LightPanel
 
LightPanel(String, String, int) - Constructor for class LightPanel
 
LightSystem - Class in <Unnamed>
 
LightSystem() - Constructor for class LightSystem
 
LightSystem(int) - Constructor for class LightSystem
 
LightSystemThread - Class in <Unnamed>
 
LightSystemThread(LightSystem, BufferedReader) - Constructor for class LightSystemThread
 
LOW - Static variable in class LightSystem
 

M

macAddrTableString() - Method in class Switch
return the MacAddrTable as a long string, one entry per line.
macTableChanged(Switch) - Method in class SwitchDisplay
This callback is called whenever the underlying Switch object changes its mac<-->port table.
macTableChanged(Switch) - Method in interface SwitchListener
 
main(String[]) - Static method in class Test
 

P

packetReceived(L3Handler, L3Packet) - Method in class L3Display
Called when a frame is received in the handler from the layer below it.
packetReceived(Layer2Endpoint, String) - Method in class L3Handler
Called when the layer below receives bits successfully.
packetReceived(L3Handler, L3Packet) - Method in interface L3Listener
 
packetReceived(Layer2Endpoint, String) - Method in interface L3ShimListener
 
pause(int) - Static method in class BitHandler
 
portAttached(Switch, SwitchPort, SwitchLightPanel) - Method in class SwitchDisplay
When a port is attached, launch a thread to monitor the state of the wire this port is connectd to.
portAttached(Switch, SwitchPort, SwitchLightPanel) - Method in interface SwitchListener
 

R

run() - Method in class BitHandler
Repeatedly (and as fast as possible), check if the panel's light has changed from on to off or vice versa.
run() - Method in class LightDisplay
Every 1 millisecond, check the LightPanel to see if the voltage is on or off.
run() - Method in class LightPanel
Read the socket from the LightSystem and turn isHigh to true or false depending on what values you get from the LightSystem.
run() - Method in class LightSystem
 
run() - Method in class LightSystemThread
 
run() - Method in class SwitchLightPanel
Read the socket from the LightSystem and turn isHigh to true or false depending on what values you get from the LightSystem.

S

send(L3Packet) - Method in class L3Handler
Given a frame, convert it to a string of bits and send it using the L3Shim on layer 2 "below".
send(String, int, int) - Method in class L3Shim
Given a string of bits to send, the layer 3 protocol these bits are part of, and the layer 2 destination to send the data to, create the 2-bit layer 3 shim header, then create the Layer2Frame and send the frame via layer 2.
send(Layer2Frame) - Method in class Layer2Handler
Given a frame, convert it to a string of bits and send it using the BitHandler on layer 1 "below".
setListener(BitListener) - Method in class BitHandler
 
setListener(L3Listener) - Method in class L3Handler
Store a reference to a listener for packets received here.
setListener(L3ShimListener, int) - Method in class L3Shim
register a listener for the protocol with number protoType.
setListener(Layer2Listener) - Method in class Layer2Handler
Allow another object (e.g., a Layer 3 object) to register itself to get called when this object receives a good frame.
setListener(SwitchListener) - Method in class Switch
Store an object to receive a callback when a port is attached.
Switch - Class in <Unnamed>
Switch models a learning switch, with multiple ports, each connected to a bus, on which computers can connect.
Switch(int) - Constructor for class Switch
Create a Switch with the given number of ports.
SwitchDisplay - Class in <Unnamed>
This class creates a GUI to represent the ports on a switch and the state of the MAC <--> port table.
SwitchDisplay(Switch) - Constructor for class SwitchDisplay
Create the GUI.
SwitchLightPanel - Class in <Unnamed>
This class is similar to a LightPanel.
SwitchLightPanel(String, String, int) - Constructor for class SwitchLightPanel
This is almost identical to a LightPanel, except we won't be writing out anything to the socket.
SwitchListener - Interface in <Unnamed>
 
switchOff() - Method in class LightPanel
Turn off the voltage on the wire -- i.e., send a LOW signal to the LightSystem to be repeated to everyone.
switchOff() - Method in class LightSystem
 
switchOn() - Method in class LightPanel
Turn on the voltage on the wire -- i.e., send a HIGH signal to the LightSystem to be repeated to everyone.
switchOn() - Method in class LightSystem
 
SwitchPort - Class in <Unnamed>
This is just like a Layer2Handler, but has no MAC Address.
SwitchPort(int) - Constructor for class SwitchPort
 
SwitchPort(String, int, int) - Constructor for class SwitchPort
 

T

Test - Class in <Unnamed>
 
Test() - Constructor for class Test
 
testLayer3() - Static method in class Test
 
testSwitch() - Static method in class Test
 
toBinary(int, int) - Static method in class Layer2Frame
Convert the integer value val to a string of 0s and 1s of the given length.
toDecimal(String) - Static method in class Layer2Frame
 
toDottedDecimal() - Method in class L3Address
Convert to dotted-decimal form: net.host
toString() - Method in class BitHandler
 
toString() - Method in class L3Address
Convert to a string of 0s and 1s for transmission over a network.
toString() - Method in class L3Packet
Create the String of 0s and 1s representing the packet.
toString() - Method in class Layer2Endpoint
A string representation of this object -- the mac address.
toString() - Method in class Layer2Frame
Create the String of 0s and 1s representing the whole frame, with the parity field on the end, and the 0 pre-amble field on the front.
toString() - Method in class LightPanel
 
toString() - Method in class SwitchPort
 
A B C D E F G H I L M P R S T 
Skip navigation links