The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
Dev Shed Forums
> Programming Languages
> Python Programming
Please solve this for me
Discuss Please solve this for me in the Python Programming forum on Dev Shed. Please solve this for me Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
Dev Shed Forums Sponsor:
January 20th, 2013, 07:52 AM
Registered User
Join Date: Jan 2013
Posts: 2
Time spent in forums: 47 m 26 sec
Reputation Power: 0
Please solve this for me
Programming*assignment*#1*
*
In*lecture,*I*presented*the*algorithm*a*switch*uses*to*learn*the*association*of*MAC*
addresses*with*its*ports.*In*this*assignment,*you*will*implement*that*algorithm*for*a*
limited*case.*
*
Assume*you*have*a*four‐port*switch.*Also*assume,*for*the*purposes*of*this*
assignment,*that*MAC*addresses*are*represented*as*integers.*Your*task*is*to*write*a*
program*that,*in*a*loop,*prompts*the*user*for*a*series*of*arriving*frames.*After*each*
frame,*the*program*will*output*the*action*to*be*taken*(forward*or*flood),*and*list*the*
port*numbers*that*are*used*for*output.*When*the*program*finishes,*it*must*output*
the*current*state*of*the*bridge*table.*
*
‐*Your*program*must*output*the*prompt:*“Input*port*number,*then*dest*and*src*MAC*
addresses”*
‐*It*must*then*be*prepared*to*read*these*values*on*a*single*line.*
‐*It*must*check*to*make*sure*the*port*number*is*between*zero*and*three.*
‐*It*must*check*to*make*sure*the*MAC*addresses*are*both*positive*integers.*
‐*If*any*of*these*conditions*are*not*met,*your*program*must*write*an*appropriate*
error*message,*and*then*prompt*the*user*for*input*again.*
‐*If*the*destination*MAC*address*is*9999*your*program*must*print*the*current*state*
of*the*bridge*table,*and*then*exit.*
‐*If*the*port*number*and*the*MAC*addresses*pass*the*error*checking,*and*the*
destination*MAC*address*is*not*9999,*your*program*must*run*the*algorithm*for*a*
learning*bridge:*
*****‐*If*the*destination*MAC*address*is*known,*the*frame*is*bridged*to*the*
appropriate*port.*
* ‐*If*the*destination*MAC*address*is*not*known,*the*frame*is*flooded*to*all*
ports,*except*the*port*on*which*it*arrived.*
* ‐*In*either*case,*the*switch*remembers*that*the*frame’s*source*MAC*
address*is*associated*with*the*incoming*port*number.*
‐*Your*program*must*then*output*either:*
‐*the*word*“Forwarding”*and*the*port*number*(from*zero*to*three)*over*
which*the*frame*is*forwarded,*or*
‐*the*word*“Flooding”*and*the*list*of*port*numbers*over*which*the*frame*
is*flooded*
‐*Your*will*then*prompt*for*the*next*frame*
‐*When*your*program*sees*a*destination*MAC*address*of*9999,*it*will*skip*the*
learning*algorithm,*print*the*list*of*(port,*MAC)*associations*(the*bridge*table),*and*
exit*
‐*You*can*assume*that*only*one*node*is*attached*to*each*port*
Comments on this post
salem
disagrees: Unreadable mess
January 20th, 2013, 08:15 AM
pollyanna
Join Date: Jul 2012
Location: Germany
I seriously hope this is just a satire on lazy students, who are too stupid to even copy and paste their assignments, let alone ask a question or -- heaven forbid -- have a thought on their own.
January 20th, 2013, 08:20 AM
Registered User
Join Date: Jan 2013
Posts: 2
Time spent in forums: 47 m 26 sec
Reputation Power: 0
Dear can u talk to me at (waqas_fire@yahoo.com) i can tell u there its very urgent pl
jacques please help me its not my work one of my friend needs it, Hope u chat me on yahoo or skype so that i can tell u the excat question
January 20th, 2013, 04:00 PM
Contributing User
Sorry, waqasalisahito, better kiss that girlfriend goodbye.
__________________
[code]
Code tags [/code] are essential for python code!
Developer Shed Advertisers and Affiliates
Thread Tools
Search this Thread
Display Modes
Rate This Thread
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off