Hi All, I am using easymac.sh script to genearte the uniq mac address. This can be downloaded from here. http://www.easyvmx.com/software/easymac.sh But How i can insure that mac geneareted by this script will be uniq in whole world. Some body in the same network also might use the same script and can get the same mac as i am . can anybody tell me, how these will be uniq ? Thanks, --Trilok _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > trilok nuwal > Sent: 13 April 2007 14:13 > To: Xen list > Subject: [Xen-users] uniq mac address generator > > Hi All, > > I am using easymac.sh script to genearte the uniq mac address. > This can be downloaded from here. > > http://www.easyvmx.com/software/easymac.sh > > But How i can insure that mac geneareted by this script will > be uniq in whole world. Some body in the same network also > might use the same script > and can get the same mac as i am . > > can anybody tell me, how these will be uniq ?It only needs to be unique to your local network - anything outside that will not be using MAC addresses to determine the routing of the packet anyways [AFAIK], so it''s meaningless to aim for uniqueness outside your own network (although it is of course practical to know that ALL MAC addresses used in the entire known world are unique). Of course, if you''re on a large corporate network, you may still have the problem that someone else uses the same easymac script to generate MAC addresses... -- Mats -- Mats> > Thanks, > --Trilok > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> I am using easymac.sh script to genearte the uniq mac address. > This can be downloaded from here. > > http://www.easyvmx.com/software/easymac.sh > > But How i can insure that mac geneareted by this script will be uniq in > whole world. Some body in the same network also might use the same script > and can get the same mac as i am . > > can anybody tell me, how these will be uniq ?They won''t be unique. But - function-wise - it does only matter if they are unique within their subnet. And that''s pretty good odds I think. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
So we cant insure that genearted mac is 100 % uniq in the same network. How much the possibility of getting the same mac address. Is it frequent or rare. Any other thing that we can try to insure the 100% uniq addresses. If we use the mac genearted by xen itself then Could we get the uniqness ? I dont think so it could insure uniqness. Because xen also genrate the same way as easymac do . If we change the easymac a bit for differnet users then probably we can achieve the uniqness. Still Doubtful... Thanks, On 4/13/07, Petersson, Mats <Mats.Petersson@amd.com> wrote:> > > > > -----Original Message----- > > From: xen-users-bounces@lists.xensource.com > > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > > trilok nuwal > > Sent: 13 April 2007 14:13 > > To: Xen list > > Subject: [Xen-users] uniq mac address generator > > > > Hi All, > > > > I am using easymac.sh script to genearte the uniq mac address. > > This can be downloaded from here. > > > > http://www.easyvmx.com/software/easymac.sh > > > > But How i can insure that mac geneareted by this script will > > be uniq in whole world. Some body in the same network also > > might use the same script > > and can get the same mac as i am . > > > > can anybody tell me, how these will be uniq ? > > It only needs to be unique to your local network - anything outside that > will not be using MAC addresses to determine the routing of the packet > anyways [AFAIK], so it''s meaningless to aim for uniqueness outside your > own network (although it is of course practical to know that ALL MAC > addresses used in the entire known world are unique). > > Of course, if you''re on a large corporate network, you may still have > the problem that someone else uses the same easymac script to generate > MAC addresses... > > -- > Mats > > -- > Mats > > > > Thanks, > > --Trilok > > > > > > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi,> But How i can insure that mac geneareted by this script will > be uniq in whole world. Some body in the same network also > might use the same script > and can get the same mac as i am .You can add a little python to your config files. That way you can bind the MAC to the vmid parameter. The vmid code is directly extracted off the example configuration. ---<snip>--- # This function checks that ''vmid'' has been given a valid value. # It is called automatically by ''xm create''. def vmid_check(var, val): val = int(val) if val <= 0: raise ValueError return val # Define the ''vmid'' variable so that ''xm create'' knows about it. xm_vars.var(''vmid'', use="Virtual machine id. Integer greater than 0.", check=vmid_check) # Check the defined variables have valid values.. xm_vars.check() # One virtual interface vif = [ ''mac=00:11:25:67:30:%0.2x,rate=1024B/s'' % vmid ] ---<snip>--- Greetings, -timo -- Timo Benk - Jabber ID: fry@downtempo.de - ICQ ID: #414944731 PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: trilok nuwal [mailto:tc.nuwal@gmail.com] > Sent: 13 April 2007 14:26 > To: Petersson, Mats > Cc: Xen list > Subject: Re: [Xen-users] uniq mac address generator > > So we cant insure that genearted mac is 100 % uniq in the > same network. > How much the possibility of getting the same mac address. Is > it frequent or rare.I just had a look at the script, and it uses "/dev/urandom", which is a device that generates random bytes. The upper half (3 bytes) of the mac-address is a constant (but you have two choices based on whether you choose "static" or "random" mac-address). The other three bytes are taken from "urandom", which we assume is a good random number generator, so relatively equal probability of hitting all numbers (_NO_ random number generator is absolutely perfect, but it''s not extremely hard to make one that gives reasonably good equality in probability). Given a 3-byte combination, you have 1 in 2^24 (16777216) to hit the same number with another machine. It''s not very likely to happen. Presumably this is only done when creating a new domain, which isn''t a very frequent occurrence [I think], which in turn means that you''re very unlikely to match with another MAC address in your lifetime.> > Any other thing that we can try to insure the 100% uniq addresses. > If we use the mac genearted by xen itself then Could we get > the uniqness ?No, because it also uses a very similar technique of random numbers.> > I dont think so it could insure uniqness. Because xen also > genrate the same way as easymac do .Exactly.> > If we change the easymac a bit for differnet users then > probably we can achieve the uniqness.If each easymac script uses different numbers (and otherwise unusued in the mac-address range) in the three first digits, then you should have no problem. The only way to entirely guarantee that YOUR mac-address is unique is to have a world-wide store of mac-addresses that are known, and "register" yours there to ensure that you are the owner of that address and no-one else uses it [but that also assumes that EVERYONE has access to this mac-address database]. But as stated before, they don''t need to be unique other than within your own network [up to the gateway]. Once it''s outside YOUR network, the mac-address is meaningless. -- Mats> > Still Doubtful... > Thanks, > > > > > > > On 4/13/07, Petersson, Mats <Mats.Petersson@amd.com> wrote: > > > > > -----Original Message----- > > From: xen-users-bounces@lists.xensource.com > > [mailto: xen-users-bounces@lists.xensource.com > <mailto:xen-users-bounces@lists.xensource.com> ] On Behalf Of > > trilok nuwal > > Sent: 13 April 2007 14:13 > > To: Xen list > > Subject: [Xen-users] uniq mac address generator > > > > Hi All, > > > > I am using easymac.sh script to genearte the uniq > mac address. > > This can be downloaded from here. > > > > http://www.easyvmx.com/software/easymac.sh > > > > But How i can insure that mac geneareted by this script will > > be uniq in whole world. Some body in the same network also > > might use the same script > > and can get the same mac as i am . > > > > can anybody tell me, how these will be uniq ? > > It only needs to be unique to your local network - > anything outside that > will not be using MAC addresses to determine the > routing of the packet > anyways [AFAIK], so it''s meaningless to aim for > uniqueness outside your > own network (although it is of course practical to know > that ALL MAC > addresses used in the entire known world are unique). > > Of course, if you''re on a large corporate network, you > may still have > the problem that someone else uses the same easymac > script to generate > MAC addresses... > > -- > Mats > > -- > Mats > > > > Thanks, > > --Trilok > > > > > > > > > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: Timo Benk [mailto:timo.benk@gmx.de] > Sent: 13 April 2007 14:34 > To: trilok nuwal > Cc: Petersson, Mats; Xen list > Subject: Re: [Xen-users] uniq mac address generator > > Hi, > > > But How i can insure that mac geneareted by this script will > > be uniq in whole world. Some body in the same network also > > might use the same script > > and can get the same mac as i am . > > You can add a little python to your config files. That way > you can bind the MAC to the vmid parameter. The vmid > code is directly extracted off the example configuration.But that''s CERTAINLY doesn''t make it unique, unless you also make sure the rest of the numbers that make up the MAC address are unique to the world. I also think you need to restrict your VMID to 0..255 in some way, such as "and 255" or "modulo 256". [Don''t know for sure how you do that in Python]. -- Mats> > ---<snip>--- > # This function checks that ''vmid'' has been given a valid value. > # It is called automatically by ''xm create''. > def vmid_check(var, val): > val = int(val) > if val <= 0: > raise ValueError > return val > > # Define the ''vmid'' variable so that ''xm create'' knows about it. > xm_vars.var(''vmid'', > use="Virtual machine id. Integer greater than 0.", > check=vmid_check) > > # Check the defined variables have valid values.. > xm_vars.check() > > > # One virtual interface > vif = [ ''mac=00:11:25:67:30:%0.2x,rate=1024B/s'' % vmid ] > ---<snip>--- > > Greetings, > -timo > -- > Timo Benk - Jabber ID: fry@downtempo.de - ICQ ID: #414944731 > PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc > > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Fri, 13 Apr 2007 15:40:45 +0200, "Petersson, Mats" <Mats.Petersson@amd.com> wrote:> > >> -----Original Message----- >> From: Timo Benk [mailto:timo.benk@gmx.de] >> Sent: 13 April 2007 14:34 >> To: trilok nuwal >> Cc: Petersson, Mats; Xen list >> Subject: Re: [Xen-users] uniq mac address generator >> >> Hi, >> >> > But How i can insure that mac geneareted by this script will >> > be uniq in whole world. Some body in the same network also >> > might use the same script >> > and can get the same mac as i am . >> >> You can add a little python to your config files. That way >> you can bind the MAC to the vmid parameter. The vmid >> code is directly extracted off the example configuration. > > But that''s CERTAINLY doesn''t make it unique, unless you also make sure > the rest of the numbers that make up the MAC address are unique to the > world. I also think you need to restrict your VMID to 0..255 in some > way, such as "and 255" or "modulo 256". [Don''t know for sure how you do > that in Python].Well, i don''t think that the intention of the original author was to ensure worldwide uniqueness. But with the skript you can ensure unique MAC-Adresses inside you network. By changeing the prefix you can run multiple Domain-0s, each with a uniq MAC-Adress space. I don''t see any advantage in generating word-wide unique MAC-Adress, however. Greetings, -timo -- Timo Benk - Jabber ID: fry@downtempo.de - ICQ ID: #414944731 PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: Timo Benk [mailto:timo.benk@gmx.de] > Sent: 13 April 2007 15:00 > To: Petersson, Mats > Cc: trilok nuwal; Xen list > Subject: RE: [Xen-users] uniq mac address generator > > On Fri, 13 Apr 2007 15:40:45 +0200, "Petersson, Mats" > <Mats.Petersson@amd.com> wrote: > > > > > >> -----Original Message----- > >> From: Timo Benk [mailto:timo.benk@gmx.de] > >> Sent: 13 April 2007 14:34 > >> To: trilok nuwal > >> Cc: Petersson, Mats; Xen list > >> Subject: Re: [Xen-users] uniq mac address generator > >> > >> Hi, > >> > >> > But How i can insure that mac geneareted by this script will > >> > be uniq in whole world. Some body in the same network also > >> > might use the same script > >> > and can get the same mac as i am . > >> > >> You can add a little python to your config files. That way > >> you can bind the MAC to the vmid parameter. The vmid > >> code is directly extracted off the example configuration. > > > > But that''s CERTAINLY doesn''t make it unique, unless you > also make sure > > the rest of the numbers that make up the MAC address are > unique to the > > world. I also think you need to restrict your VMID to 0..255 in some > > way, such as "and 255" or "modulo 256". [Don''t know for > sure how you do > > that in Python]. > > Well, i don''t think that the intention of the original author > was to ensure > worldwide uniqueness. > > But with the skript you can ensure unique MAC-Adresses inside > you network. > > By changeing the prefix you can run multiple Domain-0s, each > with a uniq > MAC-Adress space.Yes, but if you start/restart/save/restore/migrate your domain(s) sufficient number of times (and implement the modulo, otherwise you''ll just end up with a "badly formed mac-address"), you''ll have a collision every 256 VMid''s. -- Mats> > I don''t see any advantage in generating word-wide unique > MAC-Adress, however. > > Greetings, > -timo > -- > Timo Benk - Jabber ID: fry@downtempo.de - ICQ ID: #414944731 > PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc > > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Fri, 13 Apr 2007 16:04:21 +0200, "Petersson, Mats" <Mats.Petersson@amd.com> wrote:> > >> -----Original Message----- >> From: Timo Benk [mailto:timo.benk@gmx.de] >> Sent: 13 April 2007 15:00 >> To: Petersson, Mats >> Cc: trilok nuwal; Xen list >> Subject: RE: [Xen-users] uniq mac address generator >> >> On Fri, 13 Apr 2007 15:40:45 +0200, "Petersson, Mats" >> <Mats.Petersson@amd.com> wrote: >> > >> > >> >> -----Original Message----- >> >> From: Timo Benk [mailto:timo.benk@gmx.de] >> >> Sent: 13 April 2007 14:34 >> >> To: trilok nuwal >> >> Cc: Petersson, Mats; Xen list >> >> Subject: Re: [Xen-users] uniq mac address generator >> >> >> >> Hi, >> >> >> >> > But How i can insure that mac geneareted by this script will >> >> > be uniq in whole world. Some body in the same network also >> >> > might use the same script >> >> > and can get the same mac as i am . >> >> >> >> You can add a little python to your config files. That way >> >> you can bind the MAC to the vmid parameter. The vmid >> >> code is directly extracted off the example configuration. >> > >> > But that''s CERTAINLY doesn''t make it unique, unless you >> also make sure >> > the rest of the numbers that make up the MAC address are >> unique to the >> > world. I also think you need to restrict your VMID to 0..255 in some >> > way, such as "and 255" or "modulo 256". [Don''t know for >> sure how you do >> > that in Python]. >> >> Well, i don''t think that the intention of the original author >> was to ensure >> worldwide uniqueness. >> >> But with the skript you can ensure unique MAC-Adresses inside >> you network. >> >> By changeing the prefix you can run multiple Domain-0s, each >> with a uniq >> MAC-Adress space. > > Yes, but if you start/restart/save/restore/migrate your domain(s) > sufficient number of times (and implement the modulo, otherwise you''ll > just end up with a "badly formed mac-address"), you''ll have a collision > every 256 VMid''s.Why that? I don''t think that you will have 256 running domains, and if you have such many domains, add another parameter, another prefix, whatever. vmid is not equal to the domain id, but a new xm parameter. Greetings, -timo -- Timo Benk - Jabber ID: fry@downtempo.de - ICQ ID: #414944731 PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: Timo Benk [mailto:timo.benk@gmx.de] > Sent: 13 April 2007 15:16 > To: Petersson, Mats > Cc: trilok nuwal; Xen list > Subject: RE: [Xen-users] uniq mac address generator > > > > On Fri, 13 Apr 2007 16:04:21 +0200, "Petersson, Mats" > <Mats.Petersson@amd.com> wrote: > > > > > >> -----Original Message----- > >> From: Timo Benk [mailto:timo.benk@gmx.de] > >> Sent: 13 April 2007 15:00 > >> To: Petersson, Mats > >> Cc: trilok nuwal; Xen list > >> Subject: RE: [Xen-users] uniq mac address generator > >> > >> On Fri, 13 Apr 2007 15:40:45 +0200, "Petersson, Mats" > >> <Mats.Petersson@amd.com> wrote: > >> > > >> > > >> >> -----Original Message----- > >> >> From: Timo Benk [mailto:timo.benk@gmx.de] > >> >> Sent: 13 April 2007 14:34 > >> >> To: trilok nuwal > >> >> Cc: Petersson, Mats; Xen list > >> >> Subject: Re: [Xen-users] uniq mac address generator > >> >> > >> >> Hi, > >> >> > >> >> > But How i can insure that mac geneareted by this script will > >> >> > be uniq in whole world. Some body in the same network also > >> >> > might use the same script > >> >> > and can get the same mac as i am . > >> >> > >> >> You can add a little python to your config files. That way > >> >> you can bind the MAC to the vmid parameter. The vmid > >> >> code is directly extracted off the example configuration. > >> > > >> > But that''s CERTAINLY doesn''t make it unique, unless you > >> also make sure > >> > the rest of the numbers that make up the MAC address are > >> unique to the > >> > world. I also think you need to restrict your VMID to > 0..255 in some > >> > way, such as "and 255" or "modulo 256". [Don''t know for > >> sure how you do > >> > that in Python]. > >> > >> Well, i don''t think that the intention of the original author > >> was to ensure > >> worldwide uniqueness. > >> > >> But with the skript you can ensure unique MAC-Adresses inside > >> you network. > >> > >> By changeing the prefix you can run multiple Domain-0s, each > >> with a uniq > >> MAC-Adress space. > > > > Yes, but if you start/restart/save/restore/migrate your domain(s) > > sufficient number of times (and implement the modulo, > otherwise you''ll > > just end up with a "badly formed mac-address"), you''ll have > a collision > > every 256 VMid''s. > > Why that? > > I don''t think that you will have 256 running domains, and if you have > such many domains, add another parameter, another prefix, whatever. > > vmid is not equal to the domain id, but a new xm parameter.Ah, ok, that explains something I hadn''t caught on to (I''m by far not an expert on the xm-level of Xen). Having more than 256 VM''s on the same machine is probably pretty rare indeed. -- Mats> > Greetings, > -timo > > -- > Timo Benk - Jabber ID: fry@downtempo.de - ICQ ID: #414944731 > PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc > > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> It only needs to be unique to your local networkNot always true, really. For example if you run software thar generates version-1 UUIDs you could create yourself a lot of difficult to solve problems (and possibly cause data corruption) by assuming that. See for example http://jakarta.apache.org/commons/sandbox/id/uuid.html> - anything outside that > will not be using MAC addresses to determine the routing of the packet > anyways [AFAIK]MAC addresses don''t determine routing anyway, they''re at the wrong link layer.> so it''s meaningless to aim for uniqueness outside your > own network (although it is of course practical to know that ALL MAC > addresses used in the entire known world are unique).Quite a bit of software assumes this, and will do the wrong thing in very subtle ways if this assumption is not true. But the chances of getting bitten by this bug are quite small.> Of course, if you''re on a large corporate network, you may still have > the problem that someone else uses the same easymac script to generate > MAC addresses...True. And Ethernet card manufacturers have been known to ship Ethernet cards with conflicting MAC addresses anyway. James. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users