Saturday, January 07, 2012

海淘网站


一、服装类
男装女装童装综合类
http://www.amazon.com/ 万能的亚马逊涵盖需要的N多商品
http://www.endless.com/ 宝宝鞋、男女名牌鞋、手袋、首饰、手表等
http://www.bluefly.com/ 中等偏高档和高档的品牌时尚类都有
http://www.cabelas.com/ 外出狩猎钓鱼户外类的服装商品
http://www.anntaylorloft.com 品牌简约职业类女装价格适中
http://www.ae.com 时尚青年男女休闲装
http://www.gap.com/ 休闲运动装男士女士童装,国内有专柜
http://www.oldnavy.com Gap Inc集团旗下品牌之一,平民价格,有童装质量不错
http://www.drjays.com/ 嘻哈类街头艺术风格服装
http://www.victoriassecret.com/ 维多利亚秘密女装
http://shop.nordstrom.com/ 中高档女装男装童装综合网站
http://www.saksfifthavenue.com 美国奢侈品连锁店的官网
http://shop.pacsun.com/home.jsp 年轻人的牌子休闲为主,价格很便宜
http://www.abercrombie.com 现在很火的牌子AF,不过订单取消率很高基本需要代购
http://www.ralphlauren.com 国内算比较火的牌子,不过购买成功率也不高



童装类
http://www.disneystore.com 迪士尼也有宝宝衣,价格也可以
http://www.gymboree.com/ ****麻麻们都知道吧,打折时很白菜
http://www.carters.com/ 卡特官网宝宝衣服很全
http://www.gap.com/ 童装比国内有专柜全,特价时很划算
http://www.oldnavy.com Gap Inc集团旗下品牌之一,有童装,而且质量不错



二、母婴综合类
http://www.drugstore.com 母婴类都包括食品日用品衣服类综合网站
http://www.diapers.com/ 母婴类都包括食品日用品综合网站
https://www.babymallonline.com/ 童装婴幼儿专业网站
http://www.babysgotstyle.com. 母婴类都包括食品日用品综合网站



三、化妆品
http://www.drugstore.com 支持直运的保健药CNN品护肤品网站(直运很贵)
http://www.beauty.com 彩妆护肤类drugstore下属网站
http://www.folica.com/ 头发护理类用品
http://www.drugstore.com 支持直运的保健药CNN品护肤品网站(直运很贵)
http://www.beauty.com 彩妆护肤类drugstore下属网站(价格很白菜)
http://www.folica.com/ 头发护理类用品
http://www.skinstore.com 以护肤为主,涵盖大部分中档护肤品牌
http://shop.elizabetharden.com 伊丽莎白雅顿****站
http://www.esteelauder.com/ 雅诗兰黛官网(网上有使用攻略,初次购买送N多小样)
http://www.benefitcosmetics.com/ 贝玲妃美国官网(国内现在比较火的牌子)



四、食品保健品
http://www.iherb.com/ 海淘保健品首选网站,支持直邮支持中文,首次购买凭优惠码BOZ435减5美元
http://www.drugstore.com 常年有折扣
http://www.amazon.com/ 可以买到大部分国内熟知的国外牌子
http://www.boots.com/ 保健类男士女士护肤网站
http://www.vitaminlife.com 维他命生活保健品网站
http://www.vitacost.com 保健品类婴幼儿用品类,新人注册优惠减10美元,满49美元免国内运费,直邮中国3磅以内运费6.99美元(需要的短我,我来refer)。

http://www.eastbay.com 运动员常用的保健品(支持美国paypal支付)



五、箱包饰品鞋类
http://www.uggaustralia.com/index.aspx 这个不用多说了UGG
http://www.6pm.com/ 折扣时候可以拿到白菜价的鞋子和包,现在需要翻墙才能上了
http://www.footsmart.com/ 这里可以买到舒适的鞋子
http://www.shoes.com/ 中档常见的品牌鞋子都可以在找到
http://www.designershoes.com/ 女鞋专卖,各种款式的都可以找到
http://www.irvsluggage.com/ 外出旅行时候用的箱包这里很全
http://www.target.com 他家的包不时髦但很实惠
http://www.zappos.com/ 中高档包包可以看看这里

六、电器电子类商品
http://www.tigerdirect.com/ 很正规的数码电器电视购买网站(不知道是否支持国际卡)
http://www.bhphotovideo.com/ 专业摄影摄像器材网(很多专业设备哦)
http://www.ecost.com/ 电玩电器类(可以买到wii之类的娱乐设备)
http://www.jr.com/ 可以买到MP3之类的常用电器
http://www.amazon.com 万能亚马逊,几乎可以买到任何常用的DD



七、综合型购物商场
http://www.amazon.com 很全的亚马逊
http://www.saksfifthavenue.com/ 很潮流奢侈的saks
http://www.zappos.com/ 常见品牌差不多都有
http://shop.nordstrom.com 偏高档些的衣服包彩妆综合网站
http://www.buy.com/ 品种也挺全的



八、免税网站
http://www.amazon.com 很全的亚马逊也还是没有税
http://www.shopbop.com/ 时髦男女装还有箱包鞋子之类
http://www.zappos.com/ 免税免运费
http://www.backcountry.com/ 可以买到户外用品,也是没有税滴
http://www.buy.com/
http://www.newegg.com/ 新蛋的DD也是免税滴,不过不知道是否支持国际卡


九、常用工具
1、比价网 http://www.thefind.com/
2、优惠券网 www.clevermoms.com www.couponchief.com
3、亚马逊商品历史价格网 http://camelcamelcamel.com 接输入商品名称,就有价格图了
4、Amazon亚马逊网购省钱功略 http://blog.sina.com.cn/s/blog_62be10b30100ykhb.html
5、在线翻译及翻译工具 http://skycn.com/soft/48168.html 谷歌浏览器带自动翻译功能
http://translate.google.cn/?hl=zh-CN&tab=wT# 谷歌在线翻译
http://fanyi.youdao.com/web2/ 有道网页翻译
6、在线的重量转换器 http://www.zhuanhuanqi.com/danwei/ZhongLiang.html
7、衣服鞋码对照表 http://blog.sina.com.cn/s/blog_62be10b30100yihw.html
http://blog.sina.com.cn/s/blog_62be10b30100yihm.html
8、购物必备词霸翻译 http://www.iciba.com/ 不懂的赶紧查
9、尺寸转换表 http://www.americanapparel.net/sizing/default.asp 所有英寸乘以2.54就是厘米尺码咯(根据品牌衣服设计区别,尺码稍微有偏差,实际需要看网站具体提供尺寸)
10、最实用的商品反馈网:http://www.bizrate.com 所有需要购买的商品都可以看到使用者的投票,对此商品的评价,还可以通过这个网站找到你需要购买的商品的网站。

------------------------------------------------华丽的分割线-------------------------------------------------

可以用国内信用卡的网站:

UGG官网 http://www.uggaustralia.com
Tiffany官网 http://www.tiffany.com
Benefit官网 http://www.benefitcosmetics.com
Kiehl's 官网 http://www.kiehls.com
Clarins官网 http://www.clarins.com (娇韵诗中国网站比较变态,输入http://www.clarins.com,直接给转到http://cn.clarins.com,建议用代理上娇韵诗全球网站)
Chantecaille官网 http://www.chantecaille.com(中行的长城国际卡可以,招行可以)
C&E官网 http://www.crabtree-evelyn.com(招行可以)
Estee lauder官网 www.esteelauder.com (中信、广发银行可以,招行、交行不可)
Nordstrom http://shop.nordstrom.com (民生建行招行)
LANCOME官网 http://www.lancome-usa.com(招行、建行可以,其他不详)
THE BODY SHOP官网 http://www.thebodyshop-usa.com(招行可以,其他不详)
Urbandecay官网 http://www.urbandecay.com (中行长城国际卡可以,民生不可以,其他不详)
L'occitane官网 http://www.loccitane.com (工行运通,兴业,民生)
Drugstore官网 http://www.drugstore.combeauty.com
Skinstore官网 http://www.skinstore.com
NARS官网 http://www.narscosmetics.com
SKINCARERX官网 http://skincarerx.com
Saks第五大道 http://www.saksfifthavenue.com
Jurlique官网 http://www.jurlique.com
American eagle官网 http://www.ae.com
Hollister官网 http://www.hollisterco.com
Philosophy官网 http://www.philosophy.com
Swarovski官网 http://www.swarovski.com
AF官网 http://www.abercrombie.com
Victoria's Secret官网http://www.victoriassecret.com
Giorgio Armani官网 http://www.giorgioarmani.com
6pm官网(需翻墙) http://www.6pm.com
kohl's官网 http://www.kohls.com
Perricone MD裴礼康官网 http://www.perriconemd.com
Nautica官网 http://www.nautica.com
Smartbargains官网 http://www.smartbargains.com
Spalook官网 http://www.spalook.com
Smashbox官网http://www.smashbox.com (招行可以,其他不详)
GAP官网 http://www.gap.com (招行可以,其他不详)Old Navy, Banana Republic等可以一起下单
Aeropostale官网 http://www.aeropostale.com(招行可以,其他不详)
Gymboree官网 http://www.gymboree.com (招行可以,其他不详)
Bliss官网 http://www.blissworld.com (招行可以,其他不详)
Crocs官网 http://www.crocs.com (招行可以,其他不详)


不能用国内卡的:

Macy's
Clinique(建行有时候可以)
Elizabeth Arden
Gilt
Origins
Bobbibrown
Sephora
CVS
Levis
GNC(可以在Drugstore买)
Kate Spade
Guess
Walgreens(建行不行)


转一些国外的购物网站给大家,希望有帮助。
1. 高价位
www.saksfifthavenue.com
纽约第五大道汇集顶尖品牌,其余我就不用说什么了吧!
www.eluxury.com
DIOR,LV,DKNY,John Galliano, Marc Jacobs, La Perla, Versace,by Terry, Baccarat。 Hugo Boss,Fendi,Celine,Louis Vuitton等品牌的网上专营店,可以第一时间找到新品!你可以在eLUXUR上找到最热销的、最潮流的以及市场上难以找到的男士、女士高尚用品。
www.net-a-porter.com
集合欧洲的许多顶尖品牌,想找一些欧洲品牌的高档服饰可来这里挑选。
www.gloss.com
Bobbi Brown, Chanel, Clarins, Clinique, Estee Lauder,Jo Malone, La Mer, MAC, origins, Prescriptives, Rodan+Fields, Stila。无论是想了解这些品牌,还是想买这些品牌,都一定要去看看。
www.raffaello-network.com/raffties/
品牌比较全,世界一线品牌服饰聚集地。
www.forzieri.com/usa/?l=usa&c=usa&iwsid=
东西精致,绝对有品,偏重意大利制造的商品。

2. 中高价位
适合都市白领男女的网站,休闲的,正式的,参加PARTY的都有:
www.jcrew.com
www.bananarepublic.com
www.nordstrom.com
www.macys.com

3. 较低价位
www.victoriassecret.com
世界顶级内衣品牌,热辣惹火,兼做服装和化妆品,国内没有指定销售的!
www.polo.com
以男装服饰著称,女士和儿童的也不错。
www.forever21.com
www.delias.com
www.ae.com
www.abercrombie.com
www.gap.com
www.guess.com
www.xoxo.com年轻一族,青春派品牌类专营网店
嘻哈
www.hottopic.com
www.hiphopville.us
www.shopecko.com/
www.rocawear.com
4. 打折
www.bluefly.com(秋季新品也打折)
www.smartbargains.com四季打折,一打再打,绝对够便宜!
5. 综合类:综合网站里也兼售各大品牌的服装,而且价格也不错哦!
www.amazon.com
www.yoox.com
www.overstock.com
www.dillards.com

6.电子IT类
www.circuitcity.com
这可是一个有50年以上历史的电子城了,SamuelWurtzel 在1949年在1949年开了第一家电视机销售商店。一直到现在,虽然店名换了,但是,它为客户提供最新电子技术的目标一直都没有换。“我们的技术能让你 享受简单的生活。无论你来看看,还是买我们的产品,我们都和你在一起。”这是他们的服务,你不想去看看么?
www.radioshack.com
这是个美国最知名的无线通讯、电子部件、电池、配件以及数码技术的供应商。 “我们有问必答”,这是Radioshack的服务承诺。它在全美国6874个连锁商店,估计有94%的美国人居住或者工作在离RadioShack连锁 商店五分钟路程之内。这么大的商店,赶快去看看吧!
www.buydig.comm
这是个有不少联盟的影像技术商店,主要销售关于影像方面的产品,包括数码相机、普通相机、打印机、PDA、电视望远镜和录像机等等在内的各种影像产品。其中最有意思的,恐怕是各种的数码相机和望远镜了。品牌和样子都是超酷。喜欢影像技术的你,可千万别错过了!
www.ecost.com
“给你世界级的服务!”这Ecost公司的口号。这是个相当大的电子产品销售商店,有各种品牌的计算机产品、软件、数码、网络和视频产品,丰富多彩。同时,商品的价格也比较合理。选购电子产品,请来看看!
www.pcmall.com
PC Mall Sale 有限公司是一个专营PC和Mac品牌产品的计算机配件公司,销售对象包括了商务、政府教育机构以及独立的消费者。在这个网站上,有超过10万不同的产品, 来自于Compaq, Microsoft, Apple, IBM, Hewlett-Packard, Toshiba, Cisco等各大品牌。只有你想不到的,没有你找不到的。技术Fans,来看看,你需要的这里一定有!

7.零售百货
www.sharperimage.com
这是一个国际知名的专业网络零售商,主要销售市场上最新的,高质量的商品。这里的许多产品都是他们自己的开拓小作--Sharp Image Design--所设计的。Sharpimage在美国有超过180个商店,每年发行超过9千万月度目录。让你的生活过得更好更舒适。是他们的目标。来看 看,让你的生活更好更舒适!
http://shopping.discovery.com
就是世界知名的Discovery 的销售网站。这是一个很有意思的网站,象它的网名一样,去一趟,就会有发现。你可以发现许多日常用的,但是不常见的东西:包括DVD、书、玩具、衣服、家 用的、办公室用的、野外用的,都挺全的。首页的商品图片,就很吸引人。那里有可以预报天气的钟,超酷的天文望远镜,有着奇怪标志的T-Shirt,可以旋 转屏幕的DVD播放机,最薄的数码相机,和好玩的炫彩遥控玩具。这么新潮的网站,不去看一看?
www.amazon.com
不知还有什么好说的,亚马逊就是亚马逊。世界最大的网络超市之一,无数的商品每天在上面流通。几乎没有什么是你找不到的。价格,也是极其有竞争力的。还是没什么可说的,去看看就是了。
www.overstock.com
Overstock.com 是一个走在国际前端的名牌经销商,经销各类珠宝、电器、家用、影音等各类商品,种类齐全,但是它的价格却是很透明的,并且常有打折产品。这是因为它和许多 名牌产品都是合作伙伴的关系。你可以找到各种各样你喜欢的名牌,所有的产品,都有全面的技术和服务保证。买放心世界名牌,来这里就对了!
www.smartbargains.com
名牌也疯狂!Bargain并不只意味着便宜货,在这里,名牌也便宜。smartbargain可以提供最高达到70%的折扣。Smartbargain 提 供各类的衣服、珠宝、电器、家用商品等等,公司从2000年成立,已经有140万的客户曾在这里买过商品。在这里,享受名牌质量和便宜价格双重享受。犹豫 什么,快来看看吧!

8.影音制品
www.deepdiscountdvd.com
DeepDiscountDVD 是一个致力于提供低价高享受DVD的在线商店。这个网站可以通过简单的操作,买到或者搜索到各种格样的正版DVD。价格便宜,但丝毫不影响产品质量和服务质量。如果是个支持正版,有高品味,享受高质量生活的人,那么来看看吧。

9.美容时尚
www.sephora.com
Sephora 是一个欧洲的引导美容商品潮流的连锁店。现在,在美国也开了sephora连锁店和网上商城。主要经营各种品牌的美容、化妆等产品。不仅女性,男性产品也 有不少。许多品牌,是真正原产于世界化妆品之都法国。在这个商场,魅力与品味集于一体。而且,网站的索引比较方便,可以比较轻松地找到你想要的商品。爱美 是人的天性,去看看吧!

10.女性用品
www.victoriasecret.com
维多利亚的秘密,多神秘的名字。它是个在美国相当大的女性用品商店,有自己的期刊。店内包括内衣、泳装、睡衣、香水等等,是个专门诱惑有品味的女性大商场。不用说那些具体的商品,单是广告照片,看了就让人美不胜收。诱惑你的眼,诱惑你的心,快去看看吧!
www.fredericks.com
这也是个相当大的女性用品商店。店内包括各种服饰、精美的鞋、性感内衣、香水、礼物套装等等,是个有品味的大商场。想给自己买点快乐吗,可以去看看!
www.ashford.com
这可是个大礼品商城。拥有超过400个品牌的15000件产品。包括了手表、珠宝、手袋、家用、眼镜、香水、装饰等等。商品可以按价格寻找,也可以按品牌寻找。要给家人、朋友或者心爱的人挑选礼物,可别忘记了ashford。

10.女性用品
www.victoriasecret.com
维多利亚的秘密,多神秘的名字。它是个在美国相当大的女性用品商店,有自己的期刊。店内包括内衣、泳装、睡衣、香水等等,是个专门诱惑有品味的女性大商场。不用说那些具体的商品,单是广告照片,看了就让人美不胜收。诱惑你的眼,诱惑你的心,快去看看吧!
www.fredericks.com
这也是个相当大的女性用品商店。店内包括各种服饰、精美的鞋、性感内衣、香水、礼物套装等等,是个有品味的大商场。想给自己买点快乐吗,可以去看看!
www.ashford.com
这可是个大礼品商城。拥有超过400个品牌的15000件产品。包括了手表、珠宝、手袋、家用、眼镜、香水、装饰等等。商品可以按价格寻找,也可以按品牌寻找。要给家人、朋友或者心爱的人挑选礼物,可别忘记了ashford。
11.牛仔裤
Levi's官方店:http://www.levisstore.com/home/index.jsp
另外 LEE Levi's 两个牌子的牛仔裤以下两个网站里都有出售:
www.jcpenney.com
www.kohls.com
想买diesel牛仔裤到以下网站:http://www.bluefly.com

美国购物网站信息

可用国内卡的网站
直运(不收US消费税)or转运(收取US消费税)
帐单地址等其他信息

www.drugstore.com
转运。走其他州都不要税,就是NY要税
帐 单地址写转运美国处的地址。每个月第一周是GNC金卡周(8折), 其他时间不能用;每个月第三周都有GNC 7折, 当然这个核算拉;金卡一年有效,且只有小蜜蜂和GNC的产品打折。双休日DRUGSTORE服务特别慢。买drugstore走mrrebates, 有10%。无法用中国PAYPAL 。结账时勿点小广告。

http://www.gymboree.com/
可USPS直运,一般从HK转、无关税;若转运走NY,150刀以下0消费税
东西重量不高的话, 就转运;否则就直运

http://www.janieandjack.com/
可USPS直运,运费是按照购买金额来结算

oldnavy
帐单地址写转运美国处的地址

http://www.feelunique.com
直运

www.6pm.com
转运,走LAX、0消费税
用国外信用卡买东西, 返利都是0,等30天后继续在MRREBATES里申请, 就可以拿到
现在需要翻墙才能上了

www.gap.com
转运,走NY免税
帐单地址写转运美国处的地址

LESPORTSAC
转运
帐单地址写转运美国处的地址

* 还可以在KARMALOOP上买, 记得用PAYPAL付款
Tommy Hifilger
可直运。

Nautica
转运


NORDSTROM
转运
CLINIQUE,EL建议去NORDSTROM,现在送很多套装,但是下一单只能送一套。赠品常分开发货。可买UGG。帐单地址写转运美国处的地址。

KIEHLS
转运。走ORG免税。
帐单地址可以写国内的就写国内,否则就写转运美国处的地址

AMAZON
转运,除非个人商家可以直运。最会分开发货了, 更适合走AAE。
很多个人商家,东西便宜但不建议去那里买东西, 假货也多, 买化妆品过期货也多。一定要买就找AMAZON自己买。

http://www.saksfifthavenue.com
转运
帐单地址一定要写中国真实地址
招行卡容易被拒绝, 建行, 浦发的可以

http://www.shopbop.com/
可USPS直运。购物满100刀可免费USPS直运至中国。
如果金额高, 他们会要你把信用卡COPY给他们看地, 还有身份证。
可以走****站哦~有6%呢

feelunique
可直运并免全部运费
英国化妆品综合类网站.
买任何东西都可以免费送到中国
一 般接受国际运的网站, 信用卡信息, 帐单地址填写正确, 都可以顺利购买成功的~~当然其他论坛有几个JMS已经买过了, 顺利收到, 没有被扣税等问题~~~通过和那里客服的联系,了解到如果你在中国这里被海关查到缴了税,只要纳税的复印件,发给客服,他们将全额返还税金的(他们是这么 说的.)

http://www.revolveclothing.com/
可USPS直运。购物满100刀可免费USPS直运至中国。
JUICY COUTURE, 还有DIESEL, ED HARDY, D&G, MCQ by Alexander Mcqueen, Paul & Joe, 还有很多人喜欢的Dogeared项链, Y-3等等, 大牌小牌都有。
而且最最关键第一次注册的新用户, 第一次购买可以7折优惠(但不是所有品牌). 所以建议大家第一次买的时候算好, 折后超过100刀, 免得7折给你了, 但是少于100刀问你收邮费的钱

http://www.rewind-rewind.com
revolveclothing.com公司又开了一个网站, 专门outlet, 折扣满大,

http://www.forwardforward.com/
可USPS直运。购物满100刀可免费USPS直运至中国。
其实和revolveclothing是一家公司的. 不过这个定位更高, 价格更贵. 都是集合了设计师的作品, 比如今年暴火的Alexander WANG, 继VERA WANG之后又一位姓王的设计师

benefit
可USPS直运。现在购物满85刀后, 使用CODE, 就可以免费送到中国, 具体CODE是什么, 请看首页上方的提示
通过EBATES走, 可以有3%返还

www.essentialdayspa.com/
可直运。常年的200CAD免运费直送到中国
他们家是按CAD结算的。

http://www.asos.com/Beauty/
可直运。
可以在网上查它家的PROMO CODE,经常有折扣,就是品牌少了点。它家是英国的,可以直接选美金报价,会发现有个别东西要比美国价钱低。

http://www.asos.com/
可直运。现在国际普通运费一律10.5镑, 10-11天收到; 国际速递运费20磅, 4-7天收到~
因为是走英国皇家邮政, 属于民用包裹, 很安全哦~~
也是英国的购物网站~~潮牌多, 男人女人小孩都有~~~
因为是英国网站, 所以买英国和欧洲的牌子就相对便宜, 千万不要在ASOS上买美国牌子

http://www.skinstore.com/
可USPS直运,到中国的运费为14.95刀
活动超级多, 买之前先去EBATES或MRREBATES上查查活动CODE

American Apparel

https://www.brooksbrothers.com/
可直运,但国际运费很高,最好从美国转运。走OR州免税
这个牌子的男式正装(dress shirt,polo,sweater等)用料精良,品质非常出色,值得推荐

http://www.moccasinhouse.com/
转运

UGG官网
转运
有4.5%返还。也可NORDSTROM、SHOPBOP、6PM.COM

SHOES.COM
转运
帐单地址一定要写中国真实地址

shoebuy
可UPS直运,10%关税
其中state的选择没有china的,最近就是hongkong,选HONGKONG后, 再打电话去更新为CHINA。首次购物有10%折扣。Shoebuy的流苏靴不卖给中国人, 你买了也是定单取消的后果。

www.BLUEFLY.com
帐单地址可以选中国就写真实的, 不能选就写转运美国处的地址

NINE WEST
电话订购:就是先下单~~再马上打电话, 把帐单号告诉他们~~

http://www.karmaloop.com/
走MRREBATES有6%返还, (买大嘴猴的好去处, 折扣很多, 各种街头品牌。
帐单地址国家选HK, 地址写国内的地址
但是可能会发MAIL来提示要更新一下信用卡信息, 然后这时候就可以选国家为PEOPLES REPUBLIC OF CHINA了. 还会被要求需要身份验证, 如果有PAYPAL, 也可以PAYPAL付款. 更加安全可靠

http://www.quinessence.com/
买任何产品都可以免费送往中国
英国网站, 是卖精油产品的

http://www.swansonvitamins.com/
可直运。不过运费为$4.99 + actual freight。 走Fedex, 最好不要超过50刀, 怕被收税
美国保健品专卖, 牌子哈多.

http://www.florihana.com/en/

zappos
转运

JCREW
转运

LANCOME
可直运。

tiffany

Victoria's Secret
转运, 否则UPS的税太厉害了. 运到AAE NY州免税
CODE看这里http://www.retailmenot.com/view/victoriassecret.com

COACH官网
只能传真订购, 转运。
或在NORDSTROM上买

MOCCASINHOUSE
可直运。
流苏靴,买7双最核算。
帐单地址一定要写真实的地址

SHOEBUY的流苏不卖给中国人, 你买了也是定单取消的后果

Clarins

puritan's pride

LEVIS
转运
一条牛仔裤邮费最多2磅差不多了


不接受国内卡的网站

Macys(可走美国购物网. 他们不收mecys的代购费.就是每磅贵点,5.5 /磅)
RL (可尝试中信AE卡)

CLINIQUE(可去NORDSTROM)

EL(可去NORDSTROM或SAKS)
GNC官网

bloomingdale
GUCCI 官网(可去BLUEFLY, 折扣很多)


介绍3家主要经营户外用品的网站,都可以直运中国(其中3家都有部分品牌不能寄到美国以外的地址,可能是怕存在国际倒货的现象,具体情况看各网站页面)

1,www.basegear.com
注册就给一个8折的折扣码,现在打折东西最高打5折,各大户外品牌都有,包括The North Face, Marmot, Patagonia, Mountain Hard Wear,始祖鸟……服装、器材都有,东西比较全

2,www.rei.com,各大户外品牌都有,另外有专门的Outlets区,地址:http://www.rei.com/outlet
里面有各种优惠活动,比如$20一下专区,5折专区。
通过Mr.Rebates和Ebates都有3%的返利。

3,www.backcountry.com
他们家特价品比较多,通过Mr.Rebates有8%的返利,通过Ebates有4%的返利。
The North Face, Marmot, Patagonia, Mountain Hard Wear,始祖鸟……都有,有专门的打折区。 

Tuesday, November 22, 2011

Flush memcached


nc "flushall\n" localhost 11211 

Sunday, November 20, 2011

Backup and Restore Database



Back up From the Command Line (using mysqldump)

If you have shell or telnet access to your web server, you can backup your MySQL data by using the mysqldump command. This command connects to the MySQL server and creates an SQL dump file. The dump file contains the SQL statements necessary to re-create the database. Here is the proper syntax:

$ mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]
  • [uname] Your database username
  • [pass] The password for your database (note there is no space between -p and the password)
  • [dbname] The name of your database
  • [backupfile.sql] The filename for your database backup
  • [--opt] The mysqldump option

For example, to backup a database named 'Tutorials' with the username 'root' and with no password to a file tut_backup.sql, you should accomplish this command:

$ mysqldump -u root -p Tutorials > tut_backup.sql

This command will backup the 'Tutorials' database into a file called tut_backup.sql which will contain all the SQL statements needed to re-create the database.

With mysqldump command you can specify certain tables of your database you want to backup. For example, to back up only php_tutorials and asp_tutorials tables from the 'Tutorials' database accomplish the command below. Each table name has to be separated by space.

$ mysqldump -u root -p Tutorials php_tutorials asp_tutorials > tut_backup.sql

Sometimes it is necessary to back up more that one database at once. In this case you can use the --database option followed by the list of databases you would like to backup. Each database name has to be separated by space.

$ mysqldump -u root -p --databases Tutorials Articles Comments > content_backup.sql

If you want to back up all the databases in the server at one time you should use the --all-databases option. It tells MySQL to dump all the databases it has in storage.

$ mysqldump -u root -p --all-databases > alldb_backup.sql

The mysqldump command has also some other useful options:

--add-drop-table: Tells MySQL to add a DROP TABLE statement before each CREATE TABLE in the dump.

--no-data: Dumps only the database structure, not the contents.

--add-locks: Adds the LOCK TABLES and UNLOCK TABLES statements you can see in the dump file.

The mysqldump command has advantages and disadvantages. The advantages of using mysqldump are that it is simple to use and it takes care of table locking issues for you. The disadvantage is that the command locks tables. If the size of your tables is very big mysqldump can lock out users for a long period of time.

Back up your MySQL Database with Compress

If your mysql database is very big, you might want to compress the output of mysqldump. Just use the mysql backup command below and pipe the output to gzip, then you will get the output as gzip file.

$ mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz]

If you want to extract the .gz file, use the command below:

$ gunzip [backupfile.sql.gz]

Restoring your MySQL Database

Above we backup the Tutorials database into tut_backup.sql file. To re-create the Tutorials database you should follow two steps:

  • Create an appropriately named database on the target machine
  • Load the file using the mysql command:
$ mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]

Have a look how you can restore your tut_backup.sql file to the Tutorials database.

$ mysql -u root -p Tutorials < tut_backup.sql

To restore compressed backup files you can do the following:

gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]

If you need to restore a database that already exists, you'll need to use mysqlimport command. The syntax for mysqlimport is as follows:

mysqlimport -u [uname] -p[pass] [dbname] [backupfile.sql]

Creating MySQL database on Linux system

http://www.webdevelopersnotes.com/tutorials/sql/mysql_primer_creating_a_database.php3

Creating MySQL database on Linux system

  1. I assume that you are working from your account and not the root. Start a terminal session and become the superuser (Type su at the prompt and then enter the root password).
  2. Now we'll access the MySQL server. Type:
     mysql -u root -p 
    The system prompts for the MySQL root password that you set up in Installing MySQL on Linux. (Note: This is not the Linux root password but the MySQL root password). Enter the password, which is not displayed for security reasons.
    Once you are successfully logged in, the system prints a welcome message and displays the mysql prompt ... something like
     Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 1 to server version: 3.22.32  Type 'help' for help.  mysql>  
  3. Now we are ready for creating the employees database. Issue the command:
     create database employees; 
    (Note: The command ends with a semi-colon)
  4. An important point to note is that this database is created by the root and so will not be accessible to any other user unless permitted by the root. Thus, in order to use this database from my account (called manish), I have to set the permissions by issuing the following command:
     GRANT ALL ON employees.* TO manish@localhost IDENTIFIED BY "eagle" 
    The above command grants my account (manish@localhost) all the permissions on employees database and sets my password to eagle. You should replace manishwith your user name and choose an appropriate password.
  5. Close the mysql session by typing quit at the prompt. Exit from superuser and come back to your account. (Type exit).
  6. To connect to MySQL from your account, type:
     mysql -u user_name -p 
    Type in the password when prompted. (This password was set by the GRANTS ALL... command above) . The system displays the welcome message once you have successfully logged on to MySQL. Here is how your session should look like:
     [manish@localhost manish]$ mysql -u manish -p Enter password:  Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 3 to server version: 3.22.32  Type 'help' for help.  mysql>  
  7. Typing the command SHOW DATABASES; will list all the databases available on the system. You should get a display similar to:
     mysql> SHOW DATABASES; +----------------+ | Database       | +----------------+ | employees      | | mysql          | | test           | +----------------+ 3 rows in set (0.00 sec) 
  8. Enter quit at the mysql> prompt to come out of the mysql client program.

Friday, November 18, 2011

quick fix of mysqldump error 1044

mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES

To quickly fix this problem use the following switch when running mysqldump for MySQL database backups.

mysqldump -u root -p –all-databases –single-transaction > all.sql



Tuesday, November 15, 2011

Ready to use script for website backup

http://www.cyberciti.biz/tips/how-to-backup-mysql-databases-web-server-files-to-a-ftp-server-automatically.html

HowTo: Backup MySQL Databases, Web server Files to a FTP Server Automatically

by Vivek Gite on August 10, 2006 · 104 comments

This is a simple backup solution for people who run their own web server and MySQL database server on a dedicated or VPS server. Most dedicated hosting provider provides backup service using NAS or FTP servers. These service providers will hook you to their redundant centralized storage array over private VLAN. Since, I manage couple of boxes, here is my own automated solution. If you just want a shell script, go here (you just need to provided appropriate input and it will generate FTP backup script for you on fly, you can also grab my php script generator code).

Making Incremental Backups With tar

You can make tape backups. However, sometime tape is not an option. GNU tar allows you to make incremental backups with -g option. In this example, tar command will make incremental backup of /var/www/html, /home, and /etc directories, run:
# tar -g /var/log/tar-incremental.log -zcvf /backup/today.tar.gz /var/www/html /home /etc

Where,

  • -g: Create/list/extract new GNU-format incremental backup and store information to /var/log/tar-incremental.log file.

Making MySQL Databases Backup

mysqldump is a client program for dumping or backing up mysql databases, tables and data. For example, the following command displays the list of databases:
$ mysql -u root -h localhost -p -Bse 'show databases'

Output:

Enter password: brutelog cake faqs mysql phpads snews test tmp van wp

Next, you can backup each database with the mysqldump command:
$ mysqldump -u root -h localhost -pmypassword faqs | gzip -9 > faqs-db.sql.gz

Creating A Simple Backup System For Your Installation

The main advantage of using FTP or NAS backup is a protection from data loss. You can use various protocols to backup data:

  1. FTP
  2. SSH
  3. RSYNC
  4. Other Commercial solutions

However, I am going to write about FTP backup solution here. The idea is as follows:

  • Make a full backup every Sunday night i.e. backup everything every Sunday
  • Next backup only those files that has been modified since the full backup (incremental backup).
  • This is a seven-day backup cycle.

Our Sample Setup

   Your-server     ===>       ftp/nas server IP:202.54.1.10   ===>       208.111.2.5 

Let us assume that your ftp login details are as follows:

  • FTP server IP: 208.111.2.5
  • FTP Username: nixcraft
  • FTP Password: somepassword
  • FTP Directory: /home/nixcraft (or /)

You store all data as follows:
=> /home/nixcraft/full/mm-dd-yy/files - Full backup
=> /home/nixcraft/incremental/mm-dd-yy/files - Incremental backup

Automating Backup With tar

Now, you know how to backup files and mysql databases using the tar and mysqldump commands. It is time to write a shell script that will automate entire procedure:

  1. First, our script will collect all data from both MySQL database server and file system into a temporary directory called /backup using a tar command.
  2. Next, script will login to your ftp server and create a directory structure as discussed above.
  3. Script will dump all files from /backup to the ftp server.
  4. Script will remove temporary backup from /backup directory.
  5. Script will send you an email notification if ftp backups failed due to any reason.

You must have the following commands installed (use yum or apt-get package manager to install ftp client called ncftp):

  • ncftp ftp client
  • mysqldump command
  • GNU tar command

Here is the sample script:

#!/bin/sh # System + MySQL backup script # Full backup day - Sun (rest of the day do incremental backup) # Copyright (c) 2005-2006 nixCraft <http://www.cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # Automatically generated by http://bash.cyberciti.biz/backup/wizard-ftp-script.php # --------------------------------------------------------------------- ### System Setup ### DIRS="/home /etc /var/www" BACKUP=/tmp/backup.$$ NOW=$(date +"%d-%m-%Y") INCFILE="/root/tar-inc-backup.dat" DAY=$(date +"%a") FULLBACKUP="Sun" ### MySQL Setup ### MUSER="admin" MPASS="mysqladminpassword" MHOST="localhost" MYSQL="$(which mysql)" MYSQLDUMP="$(which mysqldump)" GZIP="$(which gzip)" ### FTP server Setup ### FTPD="/home/vivek/incremental" FTPU="vivek" FTPP="ftppassword" FTPS="208.111.11.2" NCFTP="$(which ncftpput)" ### Other stuff ### EMAILID="admin@theos.in" ### Start Backup for file system ### [ ! -d $BACKUP ] && mkdir -p $BACKUP || : ### See if we want to make a full backup ### if [ "$DAY" == "$FULLBACKUP" ]; then   FTPD="/home/vivek/full"   FILE="fs-full-$NOW.tar.gz"   tar -zcvf $BACKUP/$FILE $DIRS else   i=$(date +"%Hh%Mm%Ss")   FILE="fs-i-$NOW-$i.tar.gz"   tar -g $INCFILE -zcvf $BACKUP/$FILE $DIRS fi ### Start MySQL Backup ### # Get all databases name DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')" for db in $DBS do  FILE=$BACKUP/mysql-$db.$NOW-$(date +"%T").gz  $MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE done ### Dump backup using FTP ### #Start FTP backup using ncftp ncftp -u"$FTPU" -p"$FTPP" $FTPS<<EOF mkdir $FTPD mkdir $FTPD/$NOW cd $FTPD/$NOW lcd $BACKUP mput * quit EOF ### Find out if ftp backup failed or not ### if [ "$?" == "0" ]; then  rm -f $BACKUP/* else  T=/tmp/backup.fail  echo "Date: $(date)">$T  echo "Hostname: $(hostname)" >>$T  echo "Backup failed" >>$T  mail  -s "BACKUP FAILED" "$EMAILID" <$T  rm -f $T fi  

How Do I Setup a Cron Job To Backup Data Automatically?

Just add cron job as per your requirements:
13 0 * * * /home/admin/bin/ftpbackup.sh >/dev/null 2>&1

Generate FTP backup script

Since I setup many Linux boxes, here is my own FTP backup script generator. You just need to provided appropriate input and it will generate FTP backup script for you on fly.

Wednesday, October 26, 2011

How to reset MySQL root password


1. edit /etc/mysql/my.cnf
add "skip-grant-tables" in mysqld settings section

2. restart mysqld
/etc/init.d/mysql restart

3. connect mysql database
mysql -u root -p mysql

4. update root password
>update user set password=PASSWORD("12345") where user='root';
quit

5. delete the configuration added in step 1

6. restart mysqld again
/etc/init.d/mysql restart

DONE!

Sunday, October 23, 2011

Enable SSL on ubuntu apache2

http://beginlinux.com/blog/2009/01/ssl-on-ubuntu-810-apache2/

Setting up SSL with Ubuntu 8.10 is a simple process but it does have a few gotchas that you need to be aware of.  The setup has changed from 8.04.  One issue is that the +CompatEnvVars is no longer used as it created a bug in 8.10 and you will have to enable the default-ssl site to get everything working.

First, log on to your server  Install Apache:

sudo apt-get install apache2

Change to the /etc/apache2/mods-available directory and look at the available modules.  Then change to the /etc/apache2/mods-enabled directory to see what modules are enabled:

cd /etc/apache2/mods-available
ls
cd /etc/apache2/mods-enabled
ls

Now, install and enable SSL:

sudo a2enmod ssl
sudo /etc/init.d/apache2 force-reload

Change to the default webserver directory, and create a simple web page:
cd /var/www
sudo vim index.html

Add the following content:
<html>
<head>
<title>Welcome to Your_Name's Web Site</title>
</head>
<body>
<p>This is the best web site in the whole wide world.     </p>
</body>
</html>

Save and exit.  On your own local computer, open a tab or window for your web browser.  For the URL, enter:

http://IP_address_of_my_server

You should be able to view your web page.  Now, you'll want to encrypt your site.    Create the server encryption keys:

cd /etc/apache2
sudo openssl genrsa -des3 -out server.key 1024

Use this set of keys to create a certificate request:

sudo openssl req -new -key server.key -out server.csr

When asked to input data, use your imagination to create something appropriate.  Be sure to write down your passphrase.  Use this request to create your self-signed certificate:

sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Install the key and certificate:

sudo cp server.crt /etc/ssl/certs/ 
sudo cp server.key /etc/ssl/private/

Open the "defaults" file for editing:

cd /etc/apache2/sites-available
sudo vim default-ssl

This file is basically set up but you will want to uncomment  the SSLOptions line and also change the SSLCertificate lines to reflect the location and name of your new information.

SSLEngine on
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key

The port 443 is enabled when you use SSL so that is ready to go.

Enable the default SSL site:
sudo a2ensite default-ssl

If you do not enable the default-ssl you will get this error:
"ssl_error_rx_record_too_long apache"

Restart Apache.

sudo /etc/init.d/apache2 restart

That should do it.


Friday, July 22, 2011

IEEE 802.15.4 in the Context of Zigbee

http://freaklabs.org/index.php/Articles/Zigbee/IEEE-802.15.4-in-the-Context-of-Zigbee-Part-2-MAC-Layer.html
IEEE 802.15.4 in the Context of Zigbee - Part 2 - MAC Layer | Print |
Written by Akiba   
Sunday, 14 December 2008

When the economic news is too unbearably depressing to allow me to even write software, I turn to the few things that I know I can count on: my Groove Salad streaming MP3 radio station (legal, of course), a glass of wine, and the tutorial series on 802.15.4 and Zigbee that I have yet to finish. 

When we left off last time, Jan was sleeping with Jim, the transsexual who goes by the name of….wait…no, we left off at the 802.15.4 PHY layer. Well, the PHY layer is pretty straightforward unless you're an RF IC engineer, so now we're going to get into the real meat of things…the MAC layer.

The MAC layer is where all the fun is in terms of a software protocol stack. Actually, the 802.15.4 MAC is fairly complicated and feature-packed, which is why I named this series "802.15.4 in the Context of Zigbee". As the title implies, I'm only going to cover enough of 802.15.4 to understand how it fits into a protocol like Zigbee. Luckily, Zigbee eschewed a good portion of 802.15.4 in the name of simplicity and getting a spec out quick, so you won't need to know a whole bunch about 802.15.4. Unfortunately, this has also become a weakness of Zigbee.

Beacon Modes

One of the most glaring omissions of the Zigbee spec is that it doesn't use the 802.15.4 MAC in beacon mode (except for tree-only routing implementations which are impractical as I'll explain in some later article). 

The MAC layer defines two basic modes of operation: beacon mode and non-beacon mode. Beacon mode is timing dependent, where a beacon frame is sent out at some set interval defined by the implementation. The beacon defines the start of a superframe which is basically the interval between the beacons, and is used as a way for the devices on the network to synchronize with each other. The superframe is divided into two parts: the active part where data transfers occur, and the inactive part where the device can go to sleep. For very low power operation, you can define the ratio of the active time to the inactive time to be very low so that the device spends most of its time sleeping.

Superframe

In non-beacon mode, there is no concept of a superframe and the beacons are only used to discover what networks exist within a channel. In other words, beacons are only used when a device is first turned on and it scans for networks to join. Non-beacon mode is completely asynchronous so the upper layer protocol needs to treat each node as completely independent. This has certain implications, especially to power consumption. One of the biggest complaints about Zigbee is that the routers are not allowed to sleep due to the asynchronous nature of non-beacon mode. Since the routers never know if an end device is sleeping or not, it needs to always be on to receive and buffer frames for its children. The children will poll the router periodically to see if there are any messages buffered for that device. The fact that the routers are always on means that certain types of applications are non-feasible for Zigbee, such as applications where the routers do not have access to a MAINS supply.  

Media Access Control

The main purpose of the MAC layer is to provide access control to the shared channel and reliable data delivery. In layman's terms, that means that it controls the channel so that only one device is transmitting at a time and it also defines the handshaking acknowledgement when a frame is received successfully. 

So let's get started with one of the main functions of the MAC. That is to provide access control to the wireless medium. To accomplish this, it uses a simple algorithm called CSMA/CA which stands for Carrier Sense Multiple Access/Collision Avoidance. It sounds complicated, but it's really rather simple: 

Think of the street that you live on. When you pull your car out of your driveway in the morning, you need to implement CSMA/CA. As you inch your car out of the driveway, you're constantly checking your right and left rear sides to make sure no cars are coming. That's the carrier sense, where the street is the carrier. The fact that you're checking for a car other than yours coming down the street is the multiple access. You're making sure that no other cars are trying to access the road that you want to get on. If you see another car coming as you're trying to get on the road, you stop, possibly inch your car back up the driveway, and wait some unspecified amount of time for the car to pass. That's called collision avoidance. Yes, that's the genius algorithm that engineers devised for the 802.15.4 media access. It's actually slightly more complicated if you use beacon mode, however since we're only focusing on Zigbee, then we don't need to worry about that.

So now that we have the cheesy analogy out of the way, let's see how it really works. When you want to transmit a frame, the first thing you need to do is a CCA, or clear channel assessment. That means that you instruct the radio to check the receive channel and see if there is any data being transmitted, either to you or some other device on the channel that you're on. If it's clear, then you can transmit the frame. Voila!

If it's not, then you have to go into collision avoidance mode. If the channel is not clear, then you wait for a random amount of time and check the channel again. If it's still not clear, you do the same thing. To avoid ending up in an infinite loop, the implementor sets a maximum amount of CSMA backoffs that can be performed. If that amount is exceeded, then the transmit attempt is failed. This usually means you have a serious problem with the channel that you're on so your software better do something to handle it. This gets into frequency (channel) agility which we can discuss more about in the Zigbee section.

 

 CSMA/CA

802.15.4 Device Types


There are two devices types defined by the 802.15.4 spec:

  • Full Function Device (FFD):
    • Full function devices are allowed to start a network and assume the role of coordinator. They are also able to allow other FFDs or reduced function devices (RFDs) to join them. For Zigbee, FFDs are known as Zigbee Routers and are the only devices that can forward frames. They must have sufficient RAM to buffer frames for the devices that are joined to it and hold all the tables including the routing and neighbor tables. These devices usually have large flash memory footprints as well since they handle the bulk of the logic in a Zigbee network. 
  • Reduced Function Device (RFD):
    • These devices are only allowed to join FFDs and cannot have other devices join them. They cannot start a network or become a coordinator and are also not allowed to do any routing. In Zigbee, they are known as Zigbee End Devices (ZEDs). The advantage of a Zigbee End Device is that the code and RAM footprint are much smaller resulting in a lower cost device. They are also allowed to sleep so they can reduce their power consumption and survive for long periods of time on a battery.


802.15.4 MAC Topologies

802.15.4 defines two main topologies: point-to-point and star networks. A point-to-point topology is the simplest and isn't even a network. This is just a serial cable replacement where one device can transmit to another device. It's nothing too fancy so I won't spend too much time on it.

A star network is perhaps the simplest real networking topology supported by 802.15.4. It defines a central coordinator and multiple satellite devices that have joined to the coordinator. Unlike an actual star network where the data needs to pass through the center of the star before going to another satellite, an 802.15.4 star network can send data to any device within listening range. However the topology exists because the coordinator always needs to exist to start the network and the devices need to join the coordinator before they can start transmitting on the network.

Star Network Topology

The MAC layer also defines the services required for a peer-to-peer network where any device can transmit to any other device on the network. However if the receiving device is outside the listening range of the transmitting device, then the frame needs to be somehow forwarded until it reaches the destination. This forwarding mechanism is where the boundary lies between 802.15.4 and Zigbee, since Zigbee defines the mechanism and rules for forwarding frames across a network. 

Incidentally, although Zigbee is touted as supporting a mesh network, the actual Zigbee network topology is called a clustered star network. The reason that it follows this topology is because the Zigbee End Devices (ZEDs) are not allowed to perform any routing. Hence the ZEDs are just satellites to their parents. In this type of topology, only the Zigbee Routers (ZRs) are allowed to route frames to each other. A true mesh network would allow routing from any device to any other device, which implies that all devices need to have routing capabilities.

Clustered Star Topology

 

802.15.4 Frame Formats

An generic 802.15.4 frame consists of the PHY header, MAC header, MAC data payload, and the frame checksum. There are four specific types of frames that are defined by the 802.15.4 specification and the frame type is defined in the Frame Control Field, located in the first two bytes of the MAC header. After the general frame format diagram, I'll cover each individual frame type.

802.15.4 General Frame Format

 

  • Beacon:
    • The beacon frame is a special frame that is used to transmit network information and also synchronize devices on the network and can only be transmitted by full function devices. In Zigbee, the beacon is used to transmit network information and is only used for network discovery.
Beacon Frame Format

  • Data:
    • The data frame is the basic and most common frame. It's used to transmit data and can be sent as a unicast or broadcast frame. A unicast frame means that it will only go to the device specified in the destination address. A broadcast frame means that it will go out to all devices within listening range on the network.
Data Frame Format

  • Command:
    • Command frames are used for network management and control and have a command ID associated with them. The command ID will identify the type of command that is being requested and the command frame recipient will respond accordingly.
Command Frame Format

  • Acknowledge:
    • If a frame is received with its ack_request flag set, then that means that the frame requires an ACK to inform the transmitter that it was received properly. The receiver will then transmit an ACK frame which basically consists of the frame's unique identifier (DSN) and a frame ID that identifies it as an ACK.
ACK Frame Format


Addressing

There are two types of addresses in 802.15.4:

  • Extended address
    • This is an 8-byte address that is used as a universal, unique identifier for the device and will differentiate it from all other devices in the world. It is similar to the MAC address of an Ethernet device. The IEEE 64 bit address is known as the extended unique identifier (EUI) and consists of the 24-bit organizationally unique identifier (OUI) a.k.a. company ID, and a 40-bit unique identifier assigned by the company that owns the OUI. The address range needs to be purchased from the IEEE.
  • Short address
    • This is a 2-byte address that is unique only on the network that the device has joined to. It is the main addressing method used in a Zigbee network to identify a device and also serves the purpose of determining the position of the device within the Zigbee tree routing hierarchy.

 Indirect Data Transfers

Indirect transfers are used to send data to an RFD (Zigbee end device). Since it is not possible for a parent to know when a child RFD is sleeping, it cannot simply send a frame to it at any time. Hence it will buffer all frames destined to the child device. The child device will poll the parent at a set interval determined by the implementation and retrieve any pending frames for it. 

In order to poll the parent, the child sends a special frame called the data request command frame to the parent. If the parent has data for the child, the parent will indicate it in the "frame pending" field of the ACK. That will let the child know that it should keep its receiver on for the incoming data frame. Otherwise, if the ACK indicates no frames, the child will turn off its transceiver and go back to sleep.

Indirect Transfer Sequence Diagram

Network and Energy Scanning

802.15.4 defines a generic scan mechanism that allows the device to perform different types of scans. The ones most often used by Zigbee are the energy scan and the network scan. The network scan is used for Zigbee network discovery and the energy scan is used in conjunction with the network scan for Zigbee network formation.

An energy scan is a relatively simple operation where a device turns on its receiver and samples the energy level for a certain amount of time. The scan is performed on all channels that are allowed to the device, and the results of the energy scan will tell the device how much noise or interference exists on a channel. This will be useful for the device in determining an optimal channel to form a network on. 

A network scan consists of a device broadcasting a beacon request command frame. This is a command frame with an ID of "beacon request" and it will be received by all devices on the network. If an FFD receives a beacon request command frame, it must respond with a beacon frame containing information about itself and the network. The scanning device will then collect all the beacons and compile a list of FFDs within listening range as well as the different networks that exist on that channel.

Network Scan Sequence Diagram



Association

Association is the process of a device joining to a parent node. Association is very dependent on the upper layer for many of the decisions on joining criteria, so in this sense, it's basically a service that is used by the upper layer, Zigbee in this case, to join devices to the network. That being said, let's take a closer look at the association sequence. 

The association process occurs after a device finishes its network scan and chooses a suitable parent to join. The choice of a suitable parent is determined by the Zigbee stack. Once a parent is chosen, the device will issue an association request command frame to the potential parent. When the parent receives the request, it will determine if it has the capacity to add another device and is permitting other devices to join it. This is also determined by the Zigbee layer. The potential parent will then issue an association response command frame telling the device whether the join was successful or not. If it was successful, the response frame will also contain the short address that will be used to identify the node on the network. It might be kind of hard to follow so I tried to illustrate the data flow in the following sequence diagram.

You might notice that there's a slight complication where the association response is sent via indirect data transfer. This is because the parent can't send the response directly to the child in the case that the child is asleep so it uses an indirect transfer instead.

Association Sequence Diagram

 

Well, I guess that covers the major areas that I wanted to hit for the MAC layer in this part. The next part will get into the data and management services descriptions and some of the minutiae of the MAC layer, and hopefully wrap things up so I can get started on the Zigbee portion.